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

Feature : per-serie options #104

Closed
atoy40 opened this issue Sep 15, 2018 · 14 comments
Closed

Feature : per-serie options #104

atoy40 opened this issue Sep 15, 2018 · 14 comments

Comments

@atoy40
Copy link

atoy40 commented Sep 15, 2018

Hello,

Is it possible to set per-serie options, for example different stroke width, fill type, etc... ? The only one I've seen is the color through the "colors" array

Anthony.

@junedchhipa
Copy link
Contributor

junedchhipa commented Sep 15, 2018

Hi @atoy40

Good question and I have thought about this while creating configurations.

The reason I have not provided design config in the series is that I wanted to the keep data independent from all other configuration.

But, some options accepts an array which corresponds to the series index.

Some of those properties
stroke.width
markers.colors

The fill option currently doesn't accept an array, because it will require some drastic change in modules/Graphics.js. Will think about it.

Thanks for the suggestion

@atoy40
Copy link
Author

atoy40 commented Sep 15, 2018

Thanks !
I've another question about series, have you thought about having a 2nd Y axis on the right to display series which are not on the same "scale" ?

@junedchhipa
Copy link
Contributor

Yes, have you checked out this?
https://apexcharts.com/javascript-chart-demos/mixed-charts/line-column/
The two series are not on the same scale in the example

@atoy40
Copy link
Author

atoy40 commented Sep 15, 2018

Oh yes, not enough doc reading :) sorry !!

@junedchhipa
Copy link
Contributor

No worries

@codezion
Copy link

Seems there is no way to have two scales and several series in each. All can be put to one or each can have their own, but no combination. Is it possible to add that feature or is there some way to get it working now?

@junedchhipa
Copy link
Contributor

It is possible to have a variable number of scales and multiple series for each scale. You have to relate yaxis to chartID. I will provide an example soon.
Also, as this is a very common requirement, I will write a post on how this can be done.

@junedchhipa junedchhipa reopened this Oct 11, 2018
@junedchhipa
Copy link
Contributor

Here you go: https://codepen.io/junedchhipa/pen/KGqwmd

In the demo, you can see - you have 3 series, but only 2 scales. You can control which series uses a particular scale in the yaxis property. Try changing the seriesName in yaxis and see how it corresponds with the series.

@codezion
Copy link

Thank you. The example works but it is not so simple with the real data. There seems to be hidden rules:
-As many elements in yaxis as in series
-only the last serie in that scale can be selected as common name for the scale, only way max and min do not hang the script
-forced to use max and min (only values from one scale checked automatically)
-max and min must be only at that right element in yaxis (last in a scale)
-min: -20 works only when some negative number in a serie
I try to create script that analyze data sets and create working yaxis configuration based on these rules.
Easier way to configure could be that scales can be defined separately and then scale name is given in yaxis

@junedchhipa
Copy link
Contributor

Do you have an example of any other chart library that implements the way you described?
Can you create some codepen demos to illustrate the issues you faced?
Thanks

@codezion
Copy link

In chart.js there are yaxis with id and that id can be given to the dataset, so can be like yaxis with only 3 elements and 20 datasets pointing to those like I have now. Actually trying to port that implementation to use Apexcharts instead to get more speed. There are huge amount of datapoints in those.

In your example if you write min:-20 to first yaxis elment, it crash. In the second it do not. then if you add negative value to first serie, it do not affect, but if you add to second, the scale changes.

@junedchhipa
Copy link
Contributor

Thanks for providing the details.
Yes, it crashed when I tried min: -20 in the y-axis. It's a small bug which I have just fixed while testing.

Regarding your other points, I am carefully testing each y-axis by providing min/max to each y-axis.
Soon, these minor issues will be resolved.

@girazuzta
Copy link

Hi @atoy40

Good question and I have thought about this while creating configurations.

The reason I have not provided design config in the series is that I wanted to the keep data independent from all other configuration.

But, some options accepts an array which corresponds to the series index.

Some of those properties stroke.width markers.colors

The fill option currently doesn't accept an array, because it will require some drastic change in modules/Graphics.js. Will think about it.

Thanks for the suggestion

Hi
I am interested in the per-serie options to adjust a particular timeline serie width.
@junedchhipa Have you think about how to provide fill options to resolve this?

@joshribakoff-sm
Copy link

some options accepts an array which corresponds to the series index.

Why is this not documented? The docs just say Sets the width of border for svg path which doesn't imply at all what you wrote above. Had to go searching for this issue to understand the options :)

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

5 participants