0

I'm creating a chart in WinForms with c#, what I want to do is delete the first element(Bars which represent the series at that point) at X Axis when the number of elements reaches a certain point on Axis. For example as in the given image we have 8 positions on X Axis so whenever the count goes to 10 the element at the position 1 gets deleted. Similarly like the concept of a queue.

Chart Image

TaW
  • 53,122
  • 8
  • 69
  • 111
  • Try to take the last 10 elements of the data source. – Reza Aghaei Feb 12 '21 at 07:54
  • 1
    Tag the question with the chart library which you use; for example MS Chart or Live Chart. – Reza Aghaei Feb 12 '21 at 07:55
  • If you add the data via series.points.AddXY you can use series.points.Removexxx (e.g. RemoveAt(0)) to remove the ones on the left. Or set an axix.Minimum. If you have bound the data you can remove or filter them from the data source. Btw: These are not Bars but Columns!! Bars are horizontal..! – TaW Feb 12 '21 at 08:23
  • 1
    [Examples](https://stackoverflow.com/questions/50076045/chart-auto-scroll-oscilloscope-effect/50077332?r=SearchResults&s=1|82.0484#50077332) – TaW Feb 12 '21 at 09:13
  • @RezaAghaei it is the original chart from Microsoft I don't know the name, is it MS chart ? – Nikunj Gaur Feb 12 '21 at 11:37
  • Thank you very much @TaW, your example link helped me :D – Nikunj Gaur Feb 12 '21 at 11:41

0 Answers0