I am querying from a database and plotting the retrieved data.
The query on an average returns around 10 million data points.
I am currently not able to plot them all.
Please advice.
plot more data points.
Re: plot more data points.
Hi cs_ech,
A first possibility, if you are using a FastLine series, would be setting DrawAllPoints property to false to reduce the number of points to draw.
Another possibility would be using the provided DownSampling function. Please, see the All Features\Welcome !\Functions\Extended\Reducing number of points example demo from New Features Demo (you should find it at TeeChart program's group).
And, of course, it would be also good if you could manually reduce the number of points applying your own filter before adding the points to the series.
A first possibility, if you are using a FastLine series, would be setting DrawAllPoints property to false to reduce the number of points to draw.
Another possibility would be using the provided DownSampling function. Please, see the All Features\Welcome !\Functions\Extended\Reducing number of points example demo from New Features Demo (you should find it at TeeChart program's group).
And, of course, it would be also good if you could manually reduce the number of points applying your own filter before adding the points to the series.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: plot more data points.
hi,
I am not using FastLine series but a point graph.
I was unable to activate the paging property.
Out of the 10 million data points, I am only able to plot 1000 points in one page.
I am not using FastLine series but a point graph.
I was unable to activate the paging property.
Out of the 10 million data points, I am only able to plot 1000 points in one page.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: plot more data points.
Hi cs_ech,
FastLine series are the fastest in TeeChart. I strongly suggest you to do something as in the example below. If you can't use FastLine then remove all properties that are exclusive to that series. Anyway, and as Yeray suggested, DownSampling function can also be applied to Points series.
Hope this helps!
FastLine series are the fastest in TeeChart. I strongly suggest you to do something as in the example below. If you can't use FastLine then remove all properties that are exclusive to that series. Anyway, and as Yeray suggested, DownSampling function can also be applied to Points series.
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
int nrOfSamples = 25000000;
private Steema.TeeChart.Styles.FastLine fastline1;
private System.Diagnostics.Stopwatch stopWatch;
private void InitializeChart()
{
stopWatch = new System.Diagnostics.Stopwatch();
tChart1.Aspect.View3D = false;
tChart1.Aspect.SmoothingMode =
System.Drawing.Drawing2D.SmoothingMode.HighSpeed;
tChart1.Legend.Visible = false;
tChart1.Axes.Bottom.SetMinMax(0, nrOfSamples);
fastline1 = new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
//pre-assign ChartPens
Pen rPen = new Pen(Color.Red);
Steema.TeeChart.Drawing.ChartPen redPen = new
Steema.TeeChart.Drawing.ChartPen(tChart1.Chart, rPen);
fastline1.LinePen = redPen;
fastline1.DrawAllPoints = false;
fastline1.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.None;
tChart1.AfterDraw += new
Steema.TeeChart.PaintChartEventHandler(tChart1_AfterDraw);
}
void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D
g)
{
//calculate elapsed time
//stopWatch.Stop();
TimeSpan elapsedTime = stopWatch.Elapsed;
string total = elapsedTime.TotalSeconds.ToString();
label1.Text = "Elapsed time: " + total + " s";
}
private void button1_Click(object sender, EventArgs e)
{
button1.Enabled = false;
stopWatch.Reset();
stopWatch.Start();
tChart1.AutoRepaint = false;
double[] x1 = new double[nrOfSamples];
for (int i = 0; i < x1.Length; i++)
{
x1[i] = i;
}
double[] random1 = new double[nrOfSamples];
FillArray(random1);
//fastline1.Add(x1, random1);
fastline1.XValues.Value = x1;
fastline1.XValues.Count = nrOfSamples;
fastline1.YValues.Value = random1;
fastline1.YValues.Count = nrOfSamples;
tChart1.AutoRepaint = true;
tChart1.Refresh();
Application.DoEvents();
stopWatch.Stop();
button1.Enabled = true;
}
private static void FillArray(double[] myArray)
{
Random y = new Random();
for (int i = 0; i < myArray.Length; i++)
{
myArray[i] = y.Next();
}
}
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 |
Re: plot more data points.
This code gives me following errors:
Steema.TeeChart.Drawing.ChartPen redPen = new Steema.TeeChart.Drawing.ChartPen(tChart1.Chart, rPen);
The best overloaded method match for 'Steema.TeeChart.Drawing.ChartPen.ChartPen(Steema.TeeChart.Chart, bool)' has some invalid arguments
Steema.TeeChart.Drawing.ChartPen redPen = new Steema.TeeChart.Drawing.ChartPen(tChart1.Chart, rPen);
Argument '2': cannot convert from 'System.Drawing.Pen' to 'bool'
fastline1.LinePen = redPen;
Property or indexer 'Steema.TeeChart.Styles.BaseLine.LinePen' cannot be assigned to -- it is read only
label1.Text = "Elapsed time: " + total + " s";
The name 'label1' does not exist in the current context
Steema.TeeChart.Drawing.ChartPen redPen = new Steema.TeeChart.Drawing.ChartPen(tChart1.Chart, rPen);
The best overloaded method match for 'Steema.TeeChart.Drawing.ChartPen.ChartPen(Steema.TeeChart.Chart, bool)' has some invalid arguments
Steema.TeeChart.Drawing.ChartPen redPen = new Steema.TeeChart.Drawing.ChartPen(tChart1.Chart, rPen);
Argument '2': cannot convert from 'System.Drawing.Pen' to 'bool'
fastline1.LinePen = redPen;
Property or indexer 'Steema.TeeChart.Styles.BaseLine.LinePen' cannot be assigned to -- it is read only
label1.Text = "Elapsed time: " + total + " s";
The name 'label1' does not exist in the current context
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: plot more data points.
Hi cs_ech,
As I told you in my previous reply, some of those properties are exclusive to FastLine series. If you are using Points series you'll have to remove them.Steema.TeeChart.Drawing.ChartPen redPen = new Steema.TeeChart.Drawing.ChartPen(tChart1.Chart, rPen);
The best overloaded method match for 'Steema.TeeChart.Drawing.ChartPen.ChartPen(Steema.TeeChart.Chart, bool)' has some invalid arguments
Steema.TeeChart.Drawing.ChartPen redPen = new Steema.TeeChart.Drawing.ChartPen(tChart1.Chart, rPen);
Argument '2': cannot convert from 'System.Drawing.Pen' to 'bool'
fastline1.LinePen = redPen;
Property or indexer 'Steema.TeeChart.Styles.BaseLine.LinePen' cannot be assigned to -- it is read only
You just need to drop a Label at your form and call it label1 to get this working.label1.Text = "Elapsed time: " + total + " s";
The name 'label1' does not exist in the current context
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 |