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

Timeline Feature not working in examples (and in my app) #1543

Open antonsperling opened 3 years ago

antonsperling commented 3 years ago

Describe the bug Using line-chart. In the demo app, which is described in the documentation swimlane.gitbook.io, the timeline feature does not work. The property "timeline" is set to true, but no extra-svg with zoom possibilities is beeing displayed.

Found a working demo on swimlane.github.io. Here you can tick the "timeline" checkbox and it is beeing displayed under the chart. Sadly i did not find the sources of this demo-app.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://swimlane.gitbook.io/ngx-charts/examples/line-area-charts/line-chart
  2. Click on StackBlitz Demo Link
  3. Find timeline: boolean = true;
  4. See no timeline displayed

I tried to add more data to this example, as it has only 3 values in the series, but that did not change the behaviour.

Expected behavior It would be great to see a full example code with working timeline feature.

ngx-charts version my local app uses 16.0.0 not sure which version is beeing used by the StackBlitz Demo.

annmarie-switzer commented 3 years ago

Hey @antonsperling , the timeline only works if the X axis values are "linear" or "time". I don't know what linear means in this context, but time just means they have to be Date objects. If you change all of the chart data to use Dates, like this: new Date("1990") then the timeline works in the demo.

lpjune commented 3 years ago

@annmarie-switzer comment clarified and fixed it for me, could probably close this issue