Home › forums › Using CanvasJS › Z-index for canvas chart
I have a chart with 2 y axis ,in first y axis line is drawn , in 2nd y axis bar chart is drawn ? Bar chart is overlapping the line chart , how to set something line Z-index in chart ?
Note : I use websocket for line chart so its instant and I use ajax post request to draw bar chart , so I cannot draw bar chart first.
Making column chart(the bar chart which you have mentioned) as the first data series and line chart as the second data series should work fine in your case. Please take a look at this gallery example on combination charts.
Priyanka M S
as I told , price is drawn first and column is drawn second due to ajax and websocket speed…
Irrespective of when you receive the data for charts, defining line chart as the second dataSeries and updating dataPoints of the respective dataSeries on receiving data from web-socket or AJAX should work fine in your case. Please take a look at this JSFiddle where dataPoints for 1st dataSeries, which is of type column, is updated after clicking the button.
You must be logged in to reply to this topic.