amcharts / amcharts5

The newest, fastest, and most advanced amCharts charting library for JavaScript and TypeScript apps.
Other
357 stars 95 forks source link

Axis ranges for DurationAxis #1099

Closed roman-gorkunenko closed 1 year ago

roman-gorkunenko commented 1 year ago

Hello.When all the values in DurationAxis are zero, how can I configure axis by y start from zero? Example https://codepen.io/Roman-Gorkunenko-the-flexboxer/pen/YzdZmvg I tried setting the start value like this https://www.amcharts.com/docs/v5/charts/xy-chart/axes/axis-ranges/#range-start-and-end

let rangeDataItem = yAxis.makeDataItem({ value: 0 }); let range = yAxis.createAxisRange(rangeDataItem);

but it did not help

xorspark commented 1 year ago

You're looking for the min setting to set the min/max values of the axis.

    const yAxis = chart.yAxes.push(
      am5xy.DurationAxis.new(root, {
        baseUnit: 'minute',
        min: 0,
        renderer: am5xy.AxisRendererY.new(root, {}),
      }),
    );

An Axis Range object is used to draw guides/fills at specified values.

roman-gorkunenko commented 1 year ago

Thanks a lot.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. It will be closed in 5 days unless a new comment is added.