c3js / c3

:bar_chart: A D3-based reusable chart library
http://c3js.org
MIT License
9.33k stars 1.39k forks source link

Wrong axis range after append data by flow() #2815

Open adash-dev opened 3 years ago

adash-dev commented 3 years ago

I already have data displayed in the graph (high Y values). Using flow() to reads new (much lower) values and old high values are discarded because the length parameter is used. The X and Y axis range is set incorrectly. Only when I zoom in with the mouse wheel or resize the browser window does the axis ranges be adjusted.

Is this a issue? Is there any way to force recalculated axis ranges?

C3 version: 0.7.2 D3 version: 5.16.0 Browser: Chrome OS: Windows 10

Update data:

this.$chart.flow({
   x: 'x',
   xFormat: '%Y-%m-%d %H:%M:%S.%L',
   columns: [
      dataX,
      dataY
   ],
   length: cropLen,
})