Comments (6)
Affecting me as well. Using ct-major-tenth
from chartist-plugin-legend.
Well, chartist-plugin-legend places the ul
element inside of the chart container, either before or after the svg
chart, depending on your options.
If you want the ul
to be placed, this has to be done with JS, probably the best approach ist to fork and implement a position option for flexibilty:
chart.on('created', function (data) {
// Append the legend element to the DOM
switch (options.position) {
case 'top':
chart.container.insertBefore(legendElement, chart.container.childNodes[0]);
break;
case 'bottom':
chart.container.insertBefore(legendElement, null);
break;
case 'outertop':
// Some logic to place the chart outside of the chart container
break;
}
});
How good that is and if that should be PR'd into the master sometimes, i can't say really; you might run into some unexpected styling problems because the legend is now somewhere outside the container, depending on your implementation.
from chartist-plugin-legend.
We could also allow the position
option to take a DOM element. If a DOM element is given it attaches to that element instead of inside the chart. A PR is welcome for this, don't have the time myself atm.
from chartist-plugin-legend.
That sounds sweet too, might look into it sometime soon.
from chartist-plugin-legend.
Works as of 0.6.0
. You can now enter any HTMLElement
into the position option.
from chartist-plugin-legend.
I'm closing this as this should be resolved as of 0.6.0
. If this issue remains, feel free to reopen it.
from chartist-plugin-legend.
Related Issues (20)
- Not able to add data whilst series are hidden from the legend HOT 4
- Internet Explorer has stopped working HOT 5
- Hiding a line is not persistent with data changes HOT 6
- Site doesn't work on firefox HOT 3
- Fix ESLint errors HOT 1
- Breaks Chartist's labelInterpolationFnc() option HOT 1
- Hide legend key for emptyValues if ignoreEmptyValues is true?
- chart and legend colors don't match after clicking on label HOT 1
- Not an Issue(Misleading): Styling HOT 1
- Variable series revert to their old values on hiding a line
- Plugin output js
- Select/Deselect legend items through options
- This plugin is not compatible in charts with aspectRatio
- this plugin does not render inside the SVG chart
- Legends with axis offset
- Add left and right as positions
- Dynamically Changing Legend Color
- Cannot assign the color to the legend
- Can't figure out where to plug this when using moment to generate chart HOT 1
- How to change Text Color?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chartist-plugin-legend.