I have an MSCHart control in my windows Form, coding in C#. I have an array of Data to populate the chart. I was needing to do the following with these:
Make the chart show in 10 second frames, basically my data would total up to around 15 minutes or more, but I want my chart to show the X axis on a 10 second scale.
I needed to implement a scroll bar on the bottom of my chart, so that I could click this to show me the next 10 second frame. this would start off showing the first 10 second frame, then the next ones, like (10 - 20, 20 - 30, etc)
In each 10 second frame I need to plot 170 data items from my array. then the next 10 second frame to show the next 170 data items, and this would continue to the end.
here is a snipplet of what I done so far
#region SetupChart()
public bool SetupChart()
{
try
{
this.view.chart.ChartAreas[0].AxisX.ScaleView.Size = 10;
return true;
}
catch { return false; }
}
#endregion
#region Draw()
public bool Draw()
{
try
{
view.Data = this.dllCall.GetData(1);
int startSecond = 0;
foreach (Int16 item in view.Data)
{
//this.view.chart.Series["MySeries"].Points.AddXY(startSecond, item);
this.view.chart.Series["MySeries"].Points.Add(item);
startSecond++;
}
return true;
}
catch (Exception ex)
{
this.ErrorMessage = ex.Message;
return false;
}
}