!!!###!!!title=162-How to define the mapping relationship of the axes for the combination of line chart and stacked column chart——VisActor/VChart FAQ documents!!!###!!!

How to define the mapping relationship of the axes for the combination of line chart and stacked column chart?

Question Description

In a column-line combination chart, there are 2 lines. I hope that the lower line and the column correspond to the left axis, and the top one corresponds to the right axis first. How should I configure it in vchart?

Solution

In VChart, the axis and series can flexibly configure the corresponding relationship. The seriesId configured on the axis can be configured as an array of series ids or a single series id

  • Divide the line data into two parts. If there are already two parts, you don’t need to process them. Assume that their IDs are line0 and line1 respectively, and the ID of the column is bar0.
  • Set the seriesId of the left axis to ['line0','bar0'] and the seriesId of the right axis to ['line1'].

Code Example

Quote