How to move x-axis grids on chart whenever a data is added on the chart

前端 未结 2 1434
面向向阳花
面向向阳花 2021-01-15 17:13

// gridlines are not moving along as the line point changes. what code should I add to make it look like the cpu performance chart?

    Series test1 = new Se         


        
2条回答
  •  猫巷女王i
    2021-01-15 17:42

    You have two options:

    • You can delete the oldest DataPoints from the beginning, starting once you have more than some number of points.
    • You can set a Minimum and Maximum for the X-Axis to control the displayed range.

    The former option is what you eventually need to do anyway if you are adding DataPoints fast or long..

    You may also want to use zooming to look back into the past. If you need to keep the data, you could still add the removed points into a list in memory and bring them back when needed.

提交回复
热议问题