nagix / chartjs-plugin-streaming

Chart.js plugin for live streaming data
MIT License
515 stars 130 forks source link

Possible to start the line chart from left? #158

Open GeoBrodas opened 2 years ago

GeoBrodas commented 2 years ago

Had a doubt: If it's possible to start the line chart from the left instead of right (default behavior)?

And then start to reverse the x-axis when the line chart reaches the maximum across.

Dovul commented 1 year ago

Try to change in:

const config = {
  options: {
    scales: {
      x: {
      reverse: true,
      },
     ....
    },   
  }
};

To make it reverse, then try to make async call to change it back to reverse: false when the time will equal to ttl.

nikhileshcr commented 1 year ago

Hi, Did you find any solution?

GeoBrodas commented 1 year ago

Ah I dont have a code reference to show, but I remember what i did, I think I just assigned a negative value to the x-axis, something like that, don't quite remember now.