Page 1 of 1
Graphical Error on sides of chart
Posted: Tue Jul 22, 2008 2:06 pm
by 9639364
We recently upgraded our systems from using your ActiveX version to the .NET version and found the following graphical error:
http://img291.imageshack.us/my.php?imag ... rorpx8.png
I can get the graphical error to disappear if I set the Frame.Visibility to false while I'm in debug mode, but if I set it in actual code (like in the InitializeComponent method) the graphical error is still present. I know that the Frame property is depricated and we don't actually use that property, I just noticed that the error disappeared when I changed its value. It could be because the chart is triggered to refresh once that value has been changed but that's what I'm hoping on that you guys will know
I'm running .NET 2.0 on Windows XP/x86 using VS2005 as dev environment by the way.
Cheers,
Erik
Posted: Tue Jul 22, 2008 2:25 pm
by narcis
Hi Erik,
Could you please send us a simple example project we can run "as-is" to reproduce the problem here and let us know the exact TeeChart version you are using?
You can either post your files at news://
www.steema.net/steema.public.attachments newsgroup or at our
upload page.
Thanks in advance.
Posted: Tue Jul 29, 2008 2:13 pm
by 9639364
I figured out what was causing the graphical error, namely:
Code: Select all
private void barChart_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
barChart.Graphics3D.MoveTo(barChart.Axes.Left.Position, barChart.Axes.Left.CalcYPosValue(0));
barChart.Graphics3D.LineTo(barChart.Axes.Right.Position, barChart.Axes.Left.CalcYPosValue(0));
}
When looking at the points its getting from the chart, they seem to be ok, but line is still drawn from x=0 to the left axis position for some reason, any hints on why?
Posted: Tue Jul 29, 2008 2:31 pm
by narcis
Hi CAfIT,
Ok, now I see which is the problem here. You have 2 options:
1. Setting series' VertAxis to both default vertical axes:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private Steema.TeeChart.Styles.Line line1;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line1.Pointer.Visible = true;
line1.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Both;
for (int i = 0; i < 10; i++)
{
line1.Add(0);
}
tChart1.AfterDraw += new Steema.TeeChart.PaintChartEventHandler(tChart1_AfterDraw);
}
void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
g.MoveTo(tChart1.Axes.Left.Position, tChart1.Axes.Left.CalcYPosValue(0));
g.LineTo(tChart1.Axes.Right.Position, tChart1.Axes.Left.CalcYPosValue(0));
}
2. Use bottom axis end position:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private Steema.TeeChart.Styles.Line line1;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line1.Pointer.Visible = true;
//line1.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Both;
for (int i = 0; i < 10; i++)
{
line1.Add(0);
}
tChart1.AfterDraw += new Steema.TeeChart.PaintChartEventHandler(tChart1_AfterDraw);
}
void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
g.MoveTo(tChart1.Axes.Left.Position, tChart1.Axes.Left.CalcYPosValue(0));
//g.LineTo(tChart1.Axes.Right.Position, tChart1.Axes.Left.CalcYPosValue(0));
g.LineTo(tChart1.Axes.Bottom.IEndPos, tChart1.Axes.Left.CalcYPosValue(0));
}
Posted: Tue Jul 29, 2008 2:39 pm
by 9639364
I ended up using the 2nd approach. Worked fine, thanks!
Cheers,
CAfIT