Comments (10)
I'm glad you like it! I'll be happy to write a few tests and send a pull request soon :)
from chartist-plugin-legend.
No, this is not implemented. What is your use case?
from chartist-plugin-legend.
i need to show expectation and actual as two line chart for multiple users, If i have one legend for each user it will be helpful instead of having 2 legend for each user.
from chartist-plugin-legend.
If you have a strict alternation in your datasets you can do that with custom functions, which let one legend act for two datasets and CSS.
If not, I do not see a solution, nor a proposable API for this kind of grouping.
from chartist-plugin-legend.
I have a similar use case. We had to plot two different prices for the same product, one of them as a solid line and the other as a dashed line of the same color. In that case, it makes sense to have a single legend item representing both series.
I forked the project and implemented this feature using the legendNames
option. Now, it also takes an object containing the name
property (the text of the legend item) and the series
property, which is an array of integers containing the indexes of the series associated with this legend item.
This feature can be used like this:
new Chartist.Line('.ct-chart-line-multipleseries', {
labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],
series: [
[12, 9, 7, 8, 5],
[2, 1, 3.5, 7, 3],
[1, 3, 4, 5, 6]
]
}, {
fullWidth: true,
chartPadding: {
right: 40
},
plugins: [
Chartist.plugins.legend({
legendNames: [{name: 'Red-ish', series: [0,1]}, {name: 'Yellow', series: [2]}],
})
]
});
Do you think this feature could be added to the main repository? If so, is this API ok?
from chartist-plugin-legend.
@guimeira, wow, that looks nice. Yeah, the API is fine I think. I would really appreciate a PR :). Note that you'll need to add one or more tests, since the code is a bit too tricky to go untested.
I'm fairly busy these days so it can take some days for me to review.
from chartist-plugin-legend.
This can be closed, no?
from chartist-plugin-legend.
Happy this feature is now available. Thank you ppl.
from chartist-plugin-legend.
Ugh well, yeah that is actually available on master, but not on npm yet. I wanted to update the repo with a .npmignore
file and release it properly.. if you need this right now please use the commit sha as version, but I will check if can release this today.
from chartist-plugin-legend.
I wanted to update the repo with a .npmignore file
This is not necessary, in the package.json there already is a files
property which is a whitelist of files to be uploaded to npm instead of a blacklist.
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.