Page 1 of 2
Zooming-in on my scatter graph sometimes shows diddly squat
Posted: Mon Dec 06, 2010 3:05 pm
by 13050364
Hi
I have created a scatter graph using TeeChart NET v3
There are quite a lot of points, typically around 50,000. They are in a single "Points" series When I zoom-in using the mouse (dragging a rectangle) it sometimes shows a blank. ie. zero points.
Ive noticed when I zoom in on the right side of the chart its always OK but when I zoom-in on the left side there is often nothing shown even though Ive dragged
the zoom-in box over a lot of points.
Any ideas what is happening here?
thanks
Re: Zooming-in on my scatter graph sometimes shows diddly squat
Posted: Tue Dec 07, 2010 12:30 pm
by 10050769
Hello Dave,
Could you send us a simple project because we can reproduce your problem exactly here?
Thanks
Re: Zooming-in on my scatter graph sometimes shows diddly squat
Posted: Thu Dec 23, 2010 4:01 pm
by 13050364
Thanks. Ive uploaded an executeable and a chart for for you to look at. Its compressed. Let me know if there are any problems. You need to add TeeChart.dll to make it run. I tried uploading the project including the TeeChart.dll but the file was too big.
Try zooming-in on the concentrated circular section of points. No points are displayed. The view should be full of points
Thanks.
Re: Zooming-in on my scatter graph sometimes shows diddly squat
Posted: Thu Dec 23, 2010 4:03 pm
by 13050364
The source for the executeable is very simple. Here it is.
Its in C#.Net
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace TeeChartTest10 {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e) {
tChart1.Import.Template.Load("mychart.ten");
}
}
}
Re: Zooming-in on my scatter graph sometimes shows diddly squat
Posted: Fri Dec 24, 2010 12:38 pm
by 10050769
Hello Dave,
Ok, we can reproduce your problem here, but we need that you send us your complete project where you created this chart, because we can investigate why the is produced problem. For attachments not being too big you can omit "bin" and "obj" folders. Only "Properties" folder is necessary.
Thanks,
Re: Zooming-in on my scatter graph sometimes shows diddly squat
Posted: Mon Jan 17, 2011 2:48 pm
by 13050364
Hi
Sorry for the delay in getting back (was sidetracked to something else temporarily).
Its a bit difficult for me to send the project because its so large.
I basically create the chart by reading the x and y coords into 2 arrays. I then call drawGraph(x,y) which draws the chart. ie.
public void drawGraph(int[] waves, int[] I) {
tChart1.Series.RemoveAllSeries();
Points pts = new Points();
pts.Add(waves, I);
pts.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Rectangle;
pts.Pointer.VertSize = 2;
pts.Pointer.HorizSize = 2;
pts.Pointer.Color = Color.DarkRed;
tChart1.Series.Add(pts);
tChart1.Legend.Symbol.WidthUnits = Steema.TeeChart.LegendSymbolSize.Pixels;
tChart1.Legend.Symbol.Width = 1;
}
Does this look OK?
The data looks as though its all there when I use the TeeChart editor and see all the raw data listed.
Its weird how the points vanish when I zoom-in to an area. Note: Its not all areas. It seems like just some areas the points vanish.
Re: Zooming-in on my scatter graph sometimes shows diddly squat
Posted: Mon Jan 17, 2011 5:35 pm
by 10050769
Hello Dave,
I have made simple code using your suggestion:
Code: Select all
private void InitializeChart()
{
int[] waves = new int[50000];
int[] I= new int[50000];
Random rnd = new Random();
tChart1.Series.Clear();
for(int i = 0; i<waves.Length; i++)
{
waves[i]= i;
I[i] = rnd.Next(100);
}
Steema.TeeChart.Styles.Points pts = new Steema.TeeChart.Styles.Points();
pts.Add(waves, I);
pts.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Rectangle;
pts.Pointer.VertSize = 2;
pts.Pointer.HorizSize = 2;
pts.Pointer.Color = Color.DarkRed;
tChart1.Series.Add(pts);
tChart1.Legend.Symbol.WidthUnits = Steema.TeeChart.LegendSymbolSize.Pixels;
tChart1.Legend.Symbol.Width = 1;
}
Could you please tell us if it reproduce your problem? If it doesn't reproduce your problem, please modify previous code and explain how reproduce it here.
Thanks,
Re: Zooming-in on my scatter graph sometimes shows diddly squat
Posted: Tue Jan 18, 2011 4:57 pm
by 13050364
Sandra thanks. Yes that code works OK.
I think Ive worked out why there was a problem. Its because my chart data plotted several points at the same location.
If I ensure no 2 points are the same then the graph draws OK and I can zoom into any area.
However the chart doesn't look quite right. There is a black section that doesnt show the individual points.
Ive attached it so you can take a quick look. Thanks.
Re: Zooming-in on my scatter graph sometimes shows diddly squat
Posted: Wed Jan 19, 2011 12:13 pm
by 10050769
Hello Dave,
Loading your chart1.ten and using last version 3 of TeeChart.Net, I get next image:
- ImageExampel.jpg (130.09 KiB) Viewed 18354 times
You can see I have drawn a red circle where there is condensed points area. Can you confirm us; if problem you mean is area where there is circle?
If it is your problem, is produced because you are drawing many points in this section or your chart and these are condensed. For solves this, I suggest two options:
First: Make the pointer of points smaller so you can see more points.
Second: Does the chart biggest to see the points.
Otherwise, if in the image doesn’t appear your problem please explain exactly how we can reproduce it.
I hope will helps.
Thanks,
Re: Zooming-in on my scatter graph sometimes shows diddly squat
Posted: Fri Jan 21, 2011 10:21 am
by 13050364
Sandra yes you have circled the correct area.
I tried making the points smaller but the chart doesn't look very good. Also expanding the chart doesn't help much.
Im going to try and play around with the chart editor settings and see if I can make the chart look better. Thanks for your help.
Re: Zooming-in on my scatter graph sometimes shows diddly squat
Posted: Fri Jan 21, 2011 3:04 pm
by narcis
Hi Dave,
In that case you could try setting Pointer.Style to PointerStyles.SmallDot as in the example below. If that's not enough then I recommend you to use DownSampling function as in the
All\Welcome !\Functions\Extended\Reducing number of points example at the features demo, available at TeeChart's program group, and also in the code snippet below.
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Dock = DockStyle.Fill;
tChart1.Import.Template.Load(@"C:\temp\Chart1.ten");
for (int i = 0; i < tChart1.Series.Count; i++)
{
if (tChart1[i] is Steema.TeeChart.Styles.Points)
{
Steema.TeeChart.Styles.Points points = (Steema.TeeChart.Styles.Points)tChart1[i];
points.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.SmallDot;
}
}
if (tChart1.Series.Count > 0)
{
Steema.TeeChart.Functions.DownSampling downSampling1 = new Steema.TeeChart.Functions.DownSampling(tChart1.Chart);
downSampling1.Tolerance = 5;
Steema.TeeChart.Styles.Points lessPoints = new Steema.TeeChart.Styles.Points(tChart1.Chart);
lessPoints.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.SmallDot;
lessPoints.Color = tChart1[0].Color;
lessPoints.Function = downSampling1;
lessPoints.DataSource = tChart1[0];
lessPoints.CheckDataSource();
tChart1[0].Visible = false;
}
}
Re: Zooming-in on my scatter graph sometimes shows diddly squat
Posted: Mon Jan 24, 2011 9:51 am
by 13050364
Thanks Narcis I will try that.
Ive been playing about with the TeeChart editor and I can improve the display when I set the border transparency of the Points to 50%.
However I dont know how to do this in code? I tried something like:
pts.Pointer.Border.Transparency = 50;
but of course this doesn't exist. Do you know how I do this?
Re: Zooming-in on my scatter graph sometimes shows diddly squat
Posted: Mon Jan 24, 2011 10:22 am
by 10050769
Hello Dave,
You need use in code, property pen of points as do in next lines of code:
Code: Select all
Series1.Pointer.Pen.Transparency = 50;
I hope will helps.
Thanks,
Re: Zooming-in on my scatter graph sometimes shows diddly squat
Posted: Mon Jan 24, 2011 10:33 am
by 13050364
Thanks but wont that just set the transparency of the points?
Im trying to set the transparency of the border around each point.
Re: Zooming-in on my scatter graph sometimes shows diddly squat
Posted: Mon Jan 24, 2011 12:11 pm
by 10050769
Hello Dave,
The Pen used to draw a frame around Series Pointers. So if you want change border of Pointer for each points of Series point in code, you need modify transparency using pen propriety. You can find more information about Pen in TeeChart for .Net Help.
Thanks,