Ngx-charts: [Feature] Show X or Y gridlines individually

Created on 3 Jan 2017  路  8Comments  路  Source: swimlane/ngx-charts

I'm submitting a ... (check one with "x")

[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request => Please do not submit support request here

Current behavior
Currently you can only hide or show both gridlines with showGridLines

What is the motivation / use case for changing the behavior?
It would be nice to be able to hide/show each gridline invidiually like:

  • showXAxisGrid
  • showYAxisGrid

showXAxisGrid

image

showYAxisGrid

image

Enhancement Accept PRs Moderate Med

Most helpful comment

I like it. The grid lines also don't align all the time which drives me bonkas.

All 8 comments

I like it. The grid lines also don't align all the time which drives me bonkas.

Any update on this?

Update please?

In the meantime, heres a SCSS attribute (directive syntax) you can add to your <ngx-charts...> element to hide x and y axis ticks

[hideXAxisTicks] {
  [ngx-charts-x-axis-ticks] {
    > g {
      ~ g {
        display: none;
      }
    }
  }
}
[hideYAxisTicks] {
  [ngx-charts-y-axis-ticks] {
    > g {
      ~ g {
        display: none;
      }
    }
  }
}

Example: <ngx-charts-line-chart hideXAxisTicks ... ></ngx-charts-line-chart>

@stephengardner we're having trouble integrating your sample. is there any way you could provide us with the full directive? thanks!

Hey @bobbyg603, I also wanted to hide the vertical lines in the chart. In my case, it simply worked to add a css in the component.
:: ng-deep .gridline-path-vertical { 聽聽聽聽 display: none; }

@stephengardner worked perfectly for me.

"@swimlane/ngx-charts": "^13.0.2",
"@angular/core": "~9.0.1",
"@ng-bootstrap/ng-bootstrap": "^5.2.2",

Is there any reason the above PR has not been merged in yet?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Jacquers picture Jacquers  路  3Comments

faisalnet5 picture faisalnet5  路  3Comments

lokeshdaiya picture lokeshdaiya  路  3Comments

stephanrauh picture stephanrauh  路  4Comments

workfel picture workfel  路  3Comments