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

[Feature] Show X or Y gridlines individually #148

Open kyleledbetter opened 7 years ago

kyleledbetter commented 7 years ago

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

image

showYAxisGrid

image

amcdnl commented 7 years ago

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

mikecabana commented 6 years ago

Any update on this?

stephengardner commented 6 years ago

Update please?

stephengardner commented 6 years ago

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>

bobbyg603 commented 6 years ago

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

kkumor commented 5 years ago

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

omidfarhang commented 4 years ago

@stephengardner worked perfectly for me.

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

dasco144 commented 3 years ago

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

entozoon commented 2 years ago

+1 (waiting years for this lol)

mwaysczak commented 1 year ago

+1