The same mistake has been repeated for all scale min/max attributes.
To Reproduce
Steps to reproduce the behavior:
Go to the show case application
Select a chart type supporting the {x,y}Scale{Min,Max} attributes
Select zero
See that it does not affect the chart
Expected behavior
The axis min/max should be zero.
Actual behavior
The attribute has the wrong type (should be number|undefined) and the test for undefined is wrong (should be yScaleMin !== undefined). So a zero is interpreted as falsy. Therefore, the ternary expression returns the calculated min/max instead of using zero.
Describe the bug This is wrong code: https://github.com/swimlane/ngx-charts/blob/0072792306943f91816e952c978f7b3240bd178e/projects/swimlane/ngx-charts/src/lib/line-chart/line-chart.component.ts#L399
The same mistake has been repeated for all scale min/max attributes.
To Reproduce Steps to reproduce the behavior:
Expected behavior The axis min/max should be zero.
Actual behavior The attribute has the wrong type (should be
number|undefined
) and the test for undefined is wrong (should beyScaleMin !== undefined
). So a zero is interpreted as falsy. Therefore, the ternary expression returns the calculated min/max instead of using zero.ngx-charts version 20.1.0