DownSampling does not work
Posted: Mon Apr 18, 2011 10:12 am
Hello,
i have tried to test the downsampling functionality within a simple silverlight project. During implementation i recognized a strange behaviour for this function. This behaviour occures with the winforms and also with the silverlight assembly. I try to explain this with a simple winforms example.
Create a new form and add a TChart control and a button. Use the following code in the code behind:
If the InitializeChart method is called during the Form_Load event all works pretty well. If the method is called during Button_Click event the chart is empty. What should i do to get it to work?
I use TeeChart version 4.0.2011.2087.
Thanks in advance!
i have tried to test the downsampling functionality within a simple silverlight project. During implementation i recognized a strange behaviour for this function. This behaviour occures with the winforms and also with the silverlight assembly. I try to explain this with a simple winforms example.
Create a new form and add a TChart control and a button. Use the following code in the code behind:
Code: Select all
public Form1()
{
InitializeComponent();
tChart1.Aspect.View3D = false;
tChart1.Legend.Visible = false;
}
private void Form1_Load(object sender, EventArgs e)
{
//InitializeChart(); // works like expected
}
private void button1_Click(object sender, EventArgs e)
{
InitializeChart(); // empty chart
}
private void InitializeChart()
{
Points points;
FastLine fastLine;
tChart1.Series.Add(points = new Points());
tChart1.Series.Add(fastLine = new FastLine());
DownSampling downSampling1 = new DownSampling(tChart1.Chart);
points.FillSampleValues(5000);
points.Active = false;
downSampling1.DisplayedPointCount = 100;
downSampling1.Tolerance = 10.0;
downSampling1.Method = DownSamplingMethod.Average;
fastLine.DataSource = points;
fastLine.Function = downSampling1;
}
If the InitializeChart method is called during the Form_Load event all works pretty well. If the method is called during Button_Click event the chart is empty. What should i do to get it to work?
I use TeeChart version 4.0.2011.2087.
Thanks in advance!