ngx-charts icon indicating copy to clipboard operation
ngx-charts copied to clipboard

[Feature] Show X or Y gridlines individually

Open kyleledbetter opened this issue 8 years ago • 9 comments

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

kyleledbetter avatar Jan 03 '17 03:01 kyleledbetter

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

amcdnl avatar Jan 03 '17 13:01 amcdnl

Any update on this?

mikecabana avatar Dec 06 '17 19:12 mikecabana

Update please?

stephengardner avatar Dec 25 '17 15:12 stephengardner

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 avatar Dec 25 '17 16:12 stephengardner

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

bobbyg603 avatar May 15 '18 22:05 bobbyg603

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; }

kkumor avatar Dec 14 '18 09:12 kkumor

@stephengardner worked perfectly for me.

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

omidfarhang avatar Feb 17 '20 15:02 omidfarhang

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

dasco144 avatar May 31 '21 08:05 dasco144

+1 (waiting years for this lol)

entozoon avatar May 03 '22 13:05 entozoon

+1

mwaysczak avatar Mar 02 '23 13:03 mwaysczak