Version
5.4.3
Link to Minimal Reproduction
https://jsfiddle.net/sujatve5/
Steps to Reproduce
https://jsfiddle.net/sujatve5/
Current Behavior
If z
value is set to a value greater than 5 on any serie in the chart, markLine
will always be hidden by the series
Expected Behavior
markLine
should follow the z
value of its parent serie to be on top
Environment
- OS: Windows 10
- Browser: Chrome latest
- Framework: -
Any additional comments?
When z
has to be defined on multiple series, there is no way to make a markLine
to be above of the rest.
Either the markLine
is defined on a serie with data or in a new serie with a higher z
doesn't change anything.
I need to set z
value on my series as I want my bar series to be bellow my line and scatter series. I also use z
to define a specific order with series of the same type.
The thing is that markLine
doesn't seems to care about any z
. It seems to have a hard defined z
of 5 for the line and a z
of 6 for its label. In the example, if you set the z
of the first bar serie to 4, the markLine and its label goes well in front. But that is not suitable as you can have multiple serie with higher z
.
The same goes for markArea or markPoint.
Setting a higher zlevel
on the serie with markLine doesn't help neither
This use case sounds pretty standard. I just want to show a threshold bar above my series.
I came accross every issues opened about this subject and it looks like it has been a problem for a while now (since 2017) :
#6690
#9974
#12629
#14190
5条答案
按热度按时间wvyml7n51#
Clearly a bug.
For your use case it should be fine if you just not touch the z of the bar series.
6uxekuva2#
Clearly a bug.
For your use case it should be fine if you just not touch the z of the bar series.
Unfortunately I need to use z value for other stuff, like disabling emphasis state on chart hovering (#14952 (comment)). I also want my Threshold to appears on top of my line and scatter series, not only bars, and I have charts with plenty of series.
f87krz0w3#
The default z for MarkLine is 5 (see source) and is probably not incremented with its parent's z-value.
want my Threshold to appears on top of my line and scatter series
One workaround to this bug is to use fractional z values for main series - Demo Code .
This allows for hundreds of z-planes to work with between the defaults z:0 and z:5.
0qx6xfy64#
Thanks for the workaround @helgasoft
Unfortunately for me it's still not a good solution as I also have some charts with markArea and I need it to stay in the background. You can see in the following image that the line and the bar serie stay behind the markArea.
I guess I'll just make
z
value start incrementing from 5 if I have a markArea serie, as the threshold bar will not likely to be displayed at the same time (our users can fully customize their charts).w80xi6nr5#
1.When markLine and markPoint are set on a line at the same time, the hierarchy of the two cannot be modified through z, and the z of markPoint is always greater than the z of markLine.
2.markLine and markPoint are set respectively for two different lines. After the zlevel of the two lines is changed, the z of markPoint is always greater than the z of markLine.