ZingChart: In a mixed chart, how do you adjust the z-index?
The order in which data is placed in the series
array affects the order in which each series is drawn. If the line series appears before the bar series, the line series will be drawn first and the bar series will be drawn on top of the line series.
series : [ { values : [35,42,67,89,25,34,67,85], type: "bar" }, { values : [35,42,67,89,25,34,67,85], type: "line", marker:{ size:10 } } ]
Example: https://demos.zingchart.com/view/W8W5IIQB
If we want to adjust this order we can set the zIndex
value on a series just as we would in CSS with higher numbers on top.
series: [ { values: [35,42,67,89,25,34,67,85], zIndex: 0 }, { values: [85,35,42,67,89,25,34,67], zIndex: 1, }, { values: [67,85,35,42,67,89,25,34], zIndex: 2 } ]
You can also use the zIndex
property to layer the series.
Example: https://demos.zingchart.com/view/NZK1U5C2