Hi,
I've been trying to implement a 'scrolling' ColorGrid with teeChart v2, that is when new values are added to the colorgrid, the old values from the top should be deleted, so fixed number of rows would always be visible.
What is the recommended way to remove data from colorgrid? I've tried the ColorGrid.Delete method, but it seems to fail with index out of range when e.g. colorGrid1.Delete(0,100,true) is used. When the boolean parameter omitted, that deletes items from two separate locations on the colorgrid (on top and bottom row).
Scrolling ColorGrid
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi HQO,
I could reproduce the issue here and this seems to be a bug. I've added it (TF02012067) to our defect list to be fixed for future releases.
In the meantime, a workaround can be not removing series rows but modifying left axis scales, for example:
I could reproduce the issue here and this seems to be a bug. I've added it (TF02012067) to our defect list to be fixed for future releases.
In the meantime, a workaround can be not removing series rows but modifying left axis scales, for example:
Code: Select all
private Steema.TeeChart.Styles.ColorGrid colorGrid1;
private int count = 0;
private int NumColumns = 10;
private int NumRows = 10;
private void Form1_Load(object sender, EventArgs e)
{
colorGrid1 = new Steema.TeeChart.Styles.ColorGrid(tChart1.Chart);
tChart1.Axes.Left.Inverted = true;
timer1.Enabled = true;
}
private void timer1_Tick(object sender, EventArgs e)
{
Random Y = new Random();
for (int x = 0; x < NumColumns; x++)
{
colorGrid1.Add(x, Y.Next(1000), count);
}
count++;
if (count > NumRows)
{
//colorGrid1.Delete(0, NumColumns);
tChart1.Axes.Left.SetMinMax(count - NumRows, count);
}
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |