Search code examples
chartszingchart

Two charts and one preview in ZingChart


I have 2 charts that have the same x-axis, I want one preview and when I scroll that, the 2 charts should scroll at the same time, is this feature available in ZingChart?


Solution

  • This demo should include all the elements you need:

    • 2 charts that share an x-axis
    • A preview window that controls the two charts
    • A scroll bar that controls both charts and the preview window area

    You can view the source in the demo to see that we added:

    • {graphset: [ ]} to create a collection of charts in a single container
    • zooming: true to the scaleX object for each chart
    • zoom: { shared: true } for each chart to enable sharing

    • scrollX:{ } to the second chart to add the scroll bar

    • crosshairX:{ shared: true } for shared labels when hovering over the data points

    I’m on the ZingChart team. Please let me know if this demo answers your question or if there is additional clarification I can provide.