Page 1 of 1

"Stairs" line series with null points is not drawn correctly

Posted: Mon Apr 29, 2013 7:07 am
by 16665635
TeeChart 2012.0.0.9 ActiveX component. Line series with "stairs" option selected and null point in series to cut line. First line section AFTER null point from (x.1, y.1) to (x.2, y.2) is not drawn correctly (x.1, y.1 -> x.2, y.1 -> x.2, y.2) but using y value BEFORE null point i.e. (x.1, y.1 -> x.2, y.-1 -> x.2, y.2). Pictures of a sampe data and the resulting line series attached.
TeeChart 2012 3.jpg
TeeChart 2012 3.jpg (120.83 KiB) Viewed 9975 times
TeeChart 2012 1.jpg
TeeChart 2012 1.jpg (25.8 KiB) Viewed 9974 times

Re: "Stairs" line series with null points is not drawn correctly

Posted: Mon Apr 29, 2013 10:35 am
by 10050769
Hello

I suggest you see next code, so it works in correct way for me using latest version Activex( v2012.0.0.9 ).

Code: Select all

Private Sub Form_Load()
TChart1.Aspect.View3D = False
TChart1.AddSeries scLine

With TChart1.Series(0)
.AddXY DateTime.TimeValue("13:35.40"), 4.072, "", vbBlack
.AddXY DateTime.TimeValue("13:35.51"), 3.79, "", vbBlack
.AddXY DateTime.TimeValue("13:36.02"), 3.79, "", vbBlack
.AddXY DateTime.TimeValue("13:36.24"), 4.134, "", vbBlack
.AddXY DateTime.TimeValue("13:36.24"), 4.134, "", vbBlack
.AddXY DateTime.TimeValue("13:36.28"), 3.161, "", vbBlack
.AddXY DateTime.TimeValue("13:36.40"), 4.086, "", vbBlack
.AddXY DateTime.TimeValue("13:36.51"), 4.086, "", vbBlack
 End With
TChart1.Series(0).asLine.Stairs = True
TChart1.Series(0).XValues.DateTime = True
TChart1.Series(0).SetNull 3
TChart1.Axis.Bottom.Labels.DateTimeFormat = "hh.mm.ss"
Could you tell us if previous code works in your end?

I hope will helps.

Thanks,

Re: "Stairs" line series with null points is not drawn correctly

Posted: Mon Apr 29, 2013 12:40 pm
by yeray
Hi,
jhameenniemi wrote:Line series with "stairs" option selected and null point in series to cut line
Maybe you meant FastLine series?

Re: "Stairs" line series with null points is not drawn correctly

Posted: Tue Apr 30, 2013 6:54 am
by 16665635
Sorry, I should have been more specific. Yeray, you are correct... the series is a FastLine series with "TreatNulls" property set to "Don't Paint" and "Stairs" property set to "TRUE".

We are using C++ here's a code to reproduce the problem:

Code: Select all

	m_wndChart.GetAspect().SetView3D(FALSE);

	long seriesIndex = m_wndChart.AddSeries(scFastLine);

	CSeries& series = m_wndChart.Series(seriesIndex);

	series.AddXY(TimeToDateTime("13:35.40"), 4.072, "", RGB(0, 0, 0));
	series.AddXY(TimeToDateTime("13:35.51"), 3.79, "", RGB(0, 0, 0));
	series.AddXY(TimeToDateTime("13:36.02"), 3.79, "", RGB(0, 0, 0));
	series.AddXY(TimeToDateTime("13:36.24"), 4.134, "", RGB(0, 0, 0));
	series.AddXY(TimeToDateTime("13:36.24"), 4.134, "", RGB(0, 0, 0));
	series.AddXY(TimeToDateTime("13:36.28"), 3.161, "", RGB(0, 0, 0));
	series.AddXY(TimeToDateTime("13:36.40"), 4.086, "", RGB(0, 0, 0));
	series.AddXY(TimeToDateTime("13:36.51"), 4.086, "", RGB(0, 0, 0));

	series.GetAsFastLine().SetStairs(TRUE);
	series.GetAsFastLine().SetTreatNulls(tnDontPaint);

	series.GetXValues().SetDateTime(true);
	series.SetNull(3);

	m_wndChart.GetAxis().GetBottom().GetLabels().SetDateTimeFormat("hh.mm.ss");
Line is not drawn correctly. We did not have this problem with TeeChart ActiveX 8 with the same code.

Re: "Stairs" line series with null points is not drawn correctly

Posted: Tue Apr 30, 2013 9:01 am
by yeray
Hi,

I found a fix for it (TV52016561). The next maintenance release will include it.