Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line chart- multiple lines with multiple datasets #1875

Open
TheAndre980 opened this issue Oct 31, 2022 · 2 comments
Open

Line chart- multiple lines with multiple datasets #1875

TheAndre980 opened this issue Oct 31, 2022 · 2 comments

Comments

@TheAndre980
Copy link

TheAndre980 commented Oct 31, 2022

I'm currently building a angular project where i need to draw a line chart with multiple datasets.

Angular 14
dc.js 4.2.7

Example object format:
{ id: "string", datasets: [ id: "string", data: []; color: "string"; ] }

I followed some examples and only could made a series chart where each line is an address. where's a clean run of what i've got:
https://jsfiddle.net/TheAndre98/zexncpd5/41/
*in this example the data arrays start seperated from the color string

Tried to change the dimension and tried colors with colorAcessor but nothing worked.

Is it possible to make a line chart where each line is a address and the color of the line is the from the dataset ?
Meaning multiple lines with same address but diferent colors and values.

** if not, is it possible to do something similiar with a bar chart too ?

@kum-deepak
Copy link
Collaborator

It is possible, however, I am traveling, and will take about a week. Start with https://dc-js.github.io/dc.js/docs/html/ColorMixin.html#ordinalColors__anchor which should take you near. If you need more flexibility you should check other functions from the same mixin.

@TheAndre980
Copy link
Author

It is possible, however, I am traveling, and will take about a week. Start with https://dc-js.github.io/dc.js/docs/html/ColorMixin.html#ordinalColors__anchor which should take you near. If you need more flexibility you should check other functions from the same mixin.

I already tried that with no result, it changes the line colors but its not seperating from each dataset and address...

*Updated jsFiddle with Data Object Format and dc-color: https://jsfiddle.net/TheAndre98/zexncpd5/62/
** Updated info: The dataset can have any color (not just that ones in the example). Same addresses can apear in multiple datasets at the same time. Each Line represents an address and multiple lines of the address must be drawed with the color from each dataset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants