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

yAxisTicks on Line Chart - top tick is separated from the rest of the graph #811

Open bhonea opened 6 years ago

bhonea commented 6 years ago

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

Current behavior When utilizing the yAxisTicks attribute on a line chart, the top most tick is not attached to the rest of the graph.

Expected behavior The top most Y axis tick must be attached to the graph.

Reproduction of the problem Attaching a screenshot to demonstrate, as well as the data set and html used.

<ngx-charts-line-chart
      [results]="historyMetrics"
      [scheme]="colorScheme"
      [xAxis]="true"
      [yAxis]="true"
      [legend]="true"
      [showXAxisLabel]="true"
      [showYAxisLabel]="true"
      [yAxisTicks]="[0,20,40,60,80,100]"
      [xAxisLabel]="Time"
      [yAxisLabel]="Count">
    </ngx-charts-line-chart>
screen shot 2018-04-23 at 11 59 27 am screen shot 2018-04-23 at 12 01 03 pm

data.txt

Please tell us about your environment: MacOS 10.12.6, Intellij IDEA 2017.2.6, npm

Navya-adft commented 5 years ago

@bhonea ,How to use [yAxisTicks]="[0,20,40,60,80,100]", when i use the same , its not working.

kennymce commented 4 years ago

Any news on this?

SDelhey commented 2 years ago

I encountered the same problem today, the workaround that fixed it for me was setting the yScaleMin and yScaleMax attribute accordingly.

AgtHrq commented 2 years ago

[yScaleMax]="100"

Gil9091e10 commented 1 year ago

I have the problem using yScaleMin, since even if I set the minimum value to zero, the lines come out below the value. Instead of being consecutive on the zero line. Any idea what I'm doing wrong?

<ngx-charts-line-chart [xAxis]="xAxis" [yAxis]="yAxis" [curve]="curve" [scheme]="colorScheme" [results]="gasLines" [yScaleMin]="0" [yScaleMax]="500">

image