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

Z order to control lines visible color when lines cross each other #3

Closed
Demitrius opened this issue Feb 14, 2018 · 5 comments
Closed

Comments

@Demitrius
Copy link

How can I manually set lines "z index order" on the chart?
When two lines on the same position and cross each other, first line color will above, second line will under.

Now this order depends on sequence colors/data in options, but I need choose my custom sequence.

pierresh pushed a commit that referenced this issue Feb 14, 2018
The same question were asked here morrisjs#747
Original issue #3
@pierresh
Copy link
Owner

pierresh commented Feb 14, 2018

Hello,

You can already control the sequence of data by colors, this is linked with the order of elements in ykeys.

Also, I just added the option pointSuperimposed. If you set it to false, redundant points would be offseted (default is true). You can check it in the latest version in master.

image

@Demitrius
Copy link
Author

image

This option not works properly, see it in screen 1. Code below.

Code is:
Morris.Line({
element: 'chart_x1',
data: x.cdd,
xkey: 'tt',
ykeys: ['coeshows', 'coedecline', 'coechats', 'coecfs', 'coelam'],
labels: [JCC.La[23][0], JCC.La[23][1], JCC.La[23][2], JCC.La[23][3], JCC.La[23][4]],
redraw: true,
dateFormat: __f,
lineWidth: [1, 1, 2, 2, 2],
xLabels: __i,
pointSize: 3,
lineColors: ['#63CFD8', '#1FB2BE', '#00D000', '#359ade', '#7A92A3'],
dataLabels: false,
pointSuperimposed: false,
hoverOrdered: false,
hoverReversed: true
});

If i set pointSuperimposed true, chart looks like screen 2

image

@Demitrius
Copy link
Author

Does it difficult add order when paths drawing?

pierresh pushed a commit that referenced this issue Feb 15, 2018
#3

So that
 datalabels of redundant point are same if pointSuperimposed is false
 offset of redudundant point works when linewidth is an array
@pierresh
Copy link
Owner

It did not work because your settings of lineWidth is an array. Now it should be ok.

As I wrote above, the order of paths is defined by the order in ykeys. I would rather do not modify the current design.

@Demitrius
Copy link
Author

Looks better! Thank you!

image

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