I need to update the end time on Gantt items programically. What's the best way to accomplish this?
This graph has several series with a large number of data points and is updated in real time, so efficiency is important.
Thanks!
Resize Gantt item programically?
-
- Newbie
- Posts: 16
- Joined: Wed Feb 27, 2013 12:00 am
Re: Resize Gantt item programically?
Hello Jeremy Johnson,
The data are updated automatically as you can see in next simple example:
Could you tell us if previous code help you to solve your problems?
I hope will helps.
Thanks,
The data are updated automatically as you can see in next simple example:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
Steema.TeeChart.Styles.Candle candle;
double tmpOpen, tmpClose;
Timer timer1;
Random r;
DateTime dt;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
//Series
candle = new Steema.TeeChart.Styles.Candle(tChart1.Chart);
PopulateSeries();
// Set custom axes
candle.Pointer.InflateMargins = false;
tChart1.Axes.Bottom.Labels.DateTimeFormat = "mm:ss";
tChart1.Axes.Bottom.Labels.Angle = 90;
//Timer
timer1 = new Timer();
timer1.Start();
timer1.Interval = 1000;
timer1.Tick += new EventHandler(timer1_Tick);
}
void timer1_Tick(object sender, EventArgs e)
{
PopulateSeries();
}
private void PopulateSeries()
{
r = new Random();
dt = DateTime.Now;
tChart1.AutoRepaint = false;
// show only 50 points - delete the rest
while (candle.Count > 1000)
{
candle.Delete(0);
}
if (candle.Count > 1000)
{
candle.Delete(0);
}
else
{
for (int t = 0; t < 10; t++)
{ //Candle;
tmpOpen = r.Next(100);
tmpClose = tmpOpen - r.Next(100);
candle.Add(dt, tmpOpen, tmpOpen + r.Next(50), tmpClose - r.Next(50), tmpClose);
dt = dt.AddSeconds(15);
}
}
tChart1.AutoRepaint = true;
tChart1.Refresh();
}
I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / 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 |
-
- Newbie
- Posts: 16
- Joined: Wed Feb 27, 2013 12:00 am
Re: Resize Gantt item programically?
Thanks, so I gather that to resize an item I need to delete it and then add a new item of appropriate size.
It seems I may have a more fundamental problem with performance, though (see post to follow).
It seems I may have a more fundamental problem with performance, though (see post to follow).