chart series not starting from the origin.

Hello,

I'm trying to plot a chart in which the the X axis represent the time and the Y axis represents the value received from a hardware device.

But the issue I'm facing is that when the application is started the time on the X axis is not set to current time and contain some random time values like this:



I want to know how I set the X-axis contains proper date time values starting from the time the application started.

Another Issue I'm facing is that when a value is received It gets plotted but far away from the origin like this:


Is there a way to re-adjust the grid origin (which was previously set to application start time) according to the first value received from the hardware with proper time on the X-Axis.

2 Replies 1 reply marked as answer

SG shankul gupta February 16, 2021 10:34 AM UTC

Additionally, I want only 3-4 points to be visible in the chart area. Is there a way to remove points from starting positions of Series Array so that only some points remain visible and this should repeat as the new point is added to the series.

Thanks

Edit: Able to solve this issue by using Points.RemoveAt(0) in the SeriesChangedEventHandler whenever the number of points in the series exceeded the number of points that I want to stay visible in the chart area.




YP Yuvaraj Palanisamy Syncfusion Team February 17, 2021 10:20 AM UTC

Hi Shankul gupta, 
 
You can resolve this by setting of RangePadding property of ChartAxis becomes None. 
 
[C#] 
 
chartControl1.PrimaryXAxis.RangePaddingType = ChartAxisRangePaddingType.None; 
 
 
For more details, please refer the below link. 
 
Regards, 
Yuvaraj. 


Marked as answer
Loader.
Up arrow icon