swimlane / ngx-charts

:bar_chart: Declarative Charting Framework for Angular
https://swimlane.github.io/ngx-charts/
MIT License
4.29k stars 1.15k forks source link

Hiding grid lines also hides x and y axes #1521

Open Blackbaud-JeffreyAaron opened 4 years ago

Blackbaud-JeffreyAaron commented 4 years ago

Describe the bug When showGridLines is set to false both x and y axes are also hidden.

To Reproduce Create a chart and set xAxis and yAxis to true and showGridLines to false. Notice that grid lines are hidden as expected, though the x and y axes are also hidden.

Expected behavior Grid lines should be hidden and axes should be visible.

Screenshots image

Demo https://stackblitz.com/edit/angular-hide-grid-lines-hides-axes

ngx-charts version 14.0.0

I am using angular v9.1.12, though this issue is reproducible in angular 10 as well.

Additional context Line 34 of x-axis-ticks.component.ts and line 43 of y-axis-ticks.component.ts hide all lines, including both axes, when showGridLines is set to false. I will submit a PR to add a showAxis input property to each of these components to show the axis when grid lines are hidden.

https://github.com/swimlane/ngx-charts/blob/master/projects/swimlane/ngx-charts/src/lib/common/axes/x-axis-ticks.component.ts https://github.com/swimlane/ngx-charts/blob/master/projects/swimlane/ngx-charts/src/lib/common/axes/y-axis-ticks.component.ts

trangntt-016 commented 3 years ago

I have a similar issue when showGridLines is set to true and showXAxis and showYAxis are set to false.

VinitraMk commented 2 years ago

I have the same issue with version 19.1.0. Attaching ss below: image

Demo link - https://stackblitz.com/edit/swimlane-line-chart-dbodof?embed=1&file=app/app.component.ts