swimlane / ngx-charts

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

cannot define xScaleMin of Line charts #815

Open bfheythem opened 6 years ago

bfheythem commented 6 years ago

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

Current behavior I want to define xScaleMin & xScaleMax of a Line charts Graph but I get this error on console : image

I even did an update to the latest version of ngx charts

Expected behavior

I want to Create a Line chart graph to display Daily stats for each hour so I want to define a xMin & xMax ( xMin is 00:00 (midnight ) to xMax is 23:00 (today ) Reproduction of the problem

<ngx-charts-line-chart
        [view]="view"
        [scheme]="colorScheme"
        [results]="multi"
        [gradient]="gradient"
        [xAxis]="showXAxis"
        [yAxis]="showYAxis"
        [legend]="showLegend"
        [showXAxisLabel]="showXAxisLabel"
        [showYAxisLabel]="showYAxisLabel"
        [xAxisLabel]="xAxisLabel"
        [yAxisLabel]="yAxisLabel"
        [autoScale]="autoScale"
        (select)="onSelect($event)"
        [referenceLines]="referenceLines"
        [showRefLines]=true
        [xScaleMin]="xScaleMin">
</ngx-charts-line-chart>

as for xScaleMin = moment().endOf('day').toDate();

(this is returning correct value which I could see in my console )

What is the motivation / use case for changing the behavior?

Please tell us about your environment: Operating system: Ubuntu 16.4 LTS, IDE : Webstorm , package manager : NPM

ascottb commented 6 years ago

Having same issue with ngx-charts-bar-horizontal