Last period of averageline doesnt draw

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
AIS
Newbie
Newbie
Posts: 70
Joined: Wed Jun 25, 2008 12:00 am

Last period of averageline doesnt draw

Post by AIS » Mon Aug 18, 2008 1:07 pm

Hello,

i have the problem, that if i choose an averageline in stairsmode, that the last period isnt be visible at the chart. For example there are 9 values an the average function have an period of three values. In that case the chart must draw three lines in different positions, but there only apperas two lines. I have a small sample code for you to reproduce and understand my problem:

Code: Select all

tChart1.Dock = DockStyle.Fill;
tChart1.Aspect.View3D = false;
tChart1.Axes.Left.Grid.Visible = false;
tChart1.Axes.Left.MaximumOffset = 20;
tChart1.Axes.Left.MinimumOffset = 20;

Steema.TeeChart.Styles.FastLine avgLine = new Steema.TeeChart.Styles.FastLine();
Steema.TeeChart.Styles.Points dataLine = new Steema.TeeChart.Styles.Points();

Steema.TeeChart.Functions.Average avg = new Steema.TeeChart.Functions.Average();

avgLine.Function = avg;
avgLine.Function.Period = 3;
avgLine.Function.PeriodStyle = Steema.TeeChart.Functions.PeriodStyles.NumPoints;
avgLine.Function.PeriodAlign = Steema.TeeChart.Functions.PeriodAligns.First;
avgLine.Stairs = true;
avgLine.DataSource = dataLine;
avgLine.Color = Color.Red;

dataLine.Add(2);
dataLine.Add(2);
dataLine.Add(2);

dataLine.Add(3);
dataLine.Add(3);
dataLine.Add(3);

dataLine.Add(4);
dataLine.Add(4);
dataLine.Add(4);

tChart1.Series.Add(dataLine);
tChart1.Series.Add(avgLine);
How can i solve this?

Thanks in advance!

BTW: Why doesnt work the Maximum-/MinimumOffset in the new TChart version?

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Aug 20, 2008 10:41 am

Hello,

You're correct, it's a bug, it has been added down our defect list and a fix for it will be considered to be included for the next maintenance release. In meantime, the only workaround I can think of would be to draw the missing line manually using the canvas techniques ( into the OnAfterDraw event ).
BTW: Why doesnt work the Maximum-/MinimumOffset in the new TChart version?
Yes, fixing other bug make to appear this one, we'll fix it for the next maintenance release.

Post Reply