TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
-
squemeneur
- Newbie
- Posts: 3
- Joined: Tue May 02, 2006 12:00 am
Post
by squemeneur » Wed Apr 06, 2011 1:09 pm
Hi,
I'm trying to manage a large number of points with no success...
I have to display a curve with more than 500,000 points and be able to zoom in/out on it (under silverlight)
it takes too long (for my requirements) for the zoom frame to be display and to zoom (> 10 seconds...)
can anyone help me ?
here is my code (for 50,000 points):
Code: Select all
Steema.TeeChart.Silverlight.Functions.DownSampling function1;
Steema.TeeChart.Silverlight.Styles.Points points2;
DataChart1.Chart.Series.Add(new Steema.TeeChart.Silverlight.Styles.Points());
DataChart1.Chart.Series[0].FillSampleValues(50000);
points2 = new Steema.TeeChart.Silverlight.Styles.Points(DataChart1.Chart);
points2.Pointer.Style = Steema.TeeChart.Silverlight.Styles.PointerStyles.Triangle;
points2.Color = Color.FromArgb(255, 255, 0, 0);
//points2.Visible = true;
points2.DataSource = DataChart1.Chart[0];
//points2.CheckDataSource();
function1 = new Steema.TeeChart.Silverlight.Functions.DownSampling(DataChart1.Chart);
function1.Method = Steema.TeeChart.Silverlight.Functions.DownSamplingMethod.Average;
function1.Tolerance = 10.0;
function1.DisplayedPointCount = DataChart1.Chart.Series[0].Count / (int)function1.Tolerance;//Convert.ToInt32(function1.Tolerance * 4);
points2.Function = function1;
DataChart1.Header.Text = "Number of Points reduced to " + points2.Count;
Thank you,
Simon
-
Sandra
- Site Admin
- Posts: 3132
- Joined: Fri Nov 07, 2008 12:00 am
Post
by Sandra » Thu Apr 07, 2011 3:03 pm
Hello Simon,
What about doing as in the code snippet below? It works pretty well for me here.
Code: Select all
private void InitializeChart()
{
// InitializeComponent();
tChart1.Series.Add(new Steema.TeeChart.Silverlight.Styles.Points());
//((Steema.TeeChart.Silverlight.Styles.Points)Chart1.Series[0]).Pointer.Style = Steema.TeeChart.Silverlight.Styles.PointerStyles.SmallDot;
tChart1.Series[0].FillSampleValues(50000);
tChart1.Aspect.View3D = true;
Steema.TeeChart.Silverlight.Functions.DownSampling downSampling1 = new Steema.TeeChart.Silverlight.Functions.DownSampling(tChart1.Chart);
Steema.TeeChart.Silverlight.Styles.Points points1 = new Steema.TeeChart.Silverlight.Styles.Points(tChart1.Chart);
points1.DataSource = tChart1[0];
downSampling1.Tolerance = 10.0;
downSampling1.Method = Steema.TeeChart.Silverlight.Functions.DownSamplingMethod.Average;
downSampling1.DisplayedPointCount = tChart1[0].Count / (int)downSampling1.Tolerance;
points1.Function = downSampling1;
tChart1[0].Active = false;
tChart1[0].ShowInLegend = false;
}
I hope will helps.
Thanks,