!!!###!!!title=37-When the data is all 0, how to configure the position of the x-axis——VisActor/VChart FAQ documents!!!###!!!

When the data is all 0, how to configure the position of the x-axis?

Question Description

Similar to (https://www.visactor.io/vchart/demo/line-chart/basic-line) such a line chart with all 0 data, The position of the x-axis will center the polyline. I want to adjust the position of the X-axis so that the X-axis is aligned with the Y scale of 0. How to achieve this?

Solution

Different chart libraries have different solutions. According to the demo you gave, you only need to set the axes-linear.zero of the Y axis to true.

  • barChart-axes-linear.zero = true only works if the axis is a linear axis, whether to include 0 value. When min and max are configured, this configuration item becomes invalid.

Code Example

Results

Quote