An unexpected stack of bars and a line at the top

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Mth
Newbie
Newbie
Posts: 11
Joined: Thu Dec 30, 2021 12:00 am

An unexpected stack of bars and a line at the top

Post by Mth » Wed Dec 27, 2023 12:13 pm

Visual Studio 2022,
.net7.0 console project,
Steema.TeeChart.NET.Pro (4.2023.12.14)

Hi,

First problem: When the bar value exceeds the upper range of the chart axis, an unnecessary line is drawn at the top of the chart.

Second problem: When we add two series of bars, so that one is connected to the left axis and the other to the right axis, they unexpectedly stack up.


var mChart = new TChart();
mChart.Aspect.View3D = false;

mChart.Header.Visible = false;
mChart.Legend.Visible = false;

mChart.Axes.Left.AutomaticMinimum = false;
mChart.Axes.Left.Minimum = 0;
mChart.Axes.Left.AutomaticMaximum = false;
mChart.Axes.Left.Maximum = 100;

mChart.Axes.Right.AutomaticMinimum = false;
mChart.Axes.Right.Minimum = 0;
mChart.Axes.Right.AutomaticMaximum = false;
mChart.Axes.Right.Maximum = 100;

Bar bar = new Bar(mChart.Chart);
bar.Add(0, 60);
bar.Add(20, 140);
bar.Add(40, 60);
bar.Add(80, 80);
bar.Add(100, 160);
bar.MultiBar = MultiBars.Side;

Bar bar2 = new Bar(mChart.Chart);
bar2.Add(0, 20);
bar2.Add(20, 30);
bar2.Add(40, 40);
bar2.Add(80, 10);
bar2.Add(100, 50);
bar2.MultiBar = MultiBars.Side;
bar2.CustomVertAxis = mChart.Axes.Right;

mChart.Export.Image.PNG.Width = 800;
mChart.Export.Image.PNG.Height = 400;
mChart.Export.Image.PNG.Save($"D:\\TeeChartTest\\chart_7.png");

chart_7.png
chart_7.png (19.45 KiB) Viewed 22621 times

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: An unexpected stack of bars and a line at the top

Post by Marc » Wed Dec 27, 2023 3:25 pm

Hello,

Thank you for the bug report. Point 1 is reproducible. It may be an error with the clipping region at render time; we'll take a look. bug ref bug id 2663.

Point 2 can be corrected by alllocating the right axis in this way:

Code: Select all

bar2.VertAxis = VerticalAxis.Right;
If you wish to use a Custom Vertical Axis you must first define it. More info here:

Axes tutorial.

Regards,
Marc Meumann
Steema Support

Mth
Newbie
Newbie
Posts: 11
Joined: Thu Dec 30, 2021 12:00 am

Re: An unexpected stack of bars and a line at the top

Post by Mth » Fri Dec 29, 2023 10:37 am

Hello,
Thank you for your answer.
I will use VertAxis instead of CustomVertAxis.
I was porting the code from the .Net WinForms version in which the bar2.CustomVertAxis = mChart.Axes.Right; worked correctly even though bar2.VertAxis = VerticalAxis.Right; should probably have been used there as well.

Mth
Newbie
Newbie
Posts: 11
Joined: Thu Dec 30, 2021 12:00 am

Re: An unexpected stack of bars and a line at the top

Post by Mth » Fri Aug 30, 2024 11:16 am

Hello,
Many months have passed and the clipping error at chart top (bug id 2663) still hasn't been fixed. When can I expect a fix?

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: An unexpected stack of bars and a line at the top

Post by Marc » Fri Aug 30, 2024 1:26 pm

Hello,

Yes, we've been slow to get a solution for this issue. We'll review it to get a fix into into a build very soon.

Regards,
Marc
Steema Support

Post Reply