Move bar-chart zero point to the bottom left corner

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
icecream
Newbie
Newbie
Posts: 20
Joined: Thu Aug 07, 2008 12:00 am

Move bar-chart zero point to the bottom left corner

Post by icecream » Wed Jun 24, 2015 1:54 pm

Hello,

After I added a series to the bar-chart, its zero point located in the center of the left axis.
Example:
Image

Zero point is located in the bottom left corner as soon as I start showing a data, however until data are added to the chart it looks like shown on the screenshot.
Please, help me make it look consistently without data.

Thanks.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Move bar-chart zero point to the bottom left corner

Post by Narcís » Thu Jun 25, 2015 8:18 am

Hello,

To get proper axis scaling without populating the series in the chart, you need to manually set axes scales, for example:

Code: Select all

            tChart1.Axes.Left.SetMinMax(0, 10);
If your problems persist please attach a simple example project we can run "as-is" to reproduce the problem here.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

icecream
Newbie
Newbie
Posts: 20
Joined: Thu Aug 07, 2008 12:00 am

Re: Move bar-chart zero point to the bottom left corner

Post by icecream » Thu Jun 25, 2015 8:22 am

I have already tried this way, however this sets constant maximum for the Y axis. I want it to be changed automatically depending on data.

I do not know data in advance, so I cannot set the maximum.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Move bar-chart zero point to the bottom left corner

Post by Narcís » Thu Jun 25, 2015 8:26 am

Hello,

Thanks for your feedback.

Can you please attach a Short, Self Contained, Correct (Compilable), Example?

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

icecream
Newbie
Newbie
Posts: 20
Joined: Thu Aug 07, 2008 12:00 am

Re: Move bar-chart zero point to the bottom left corner

Post by icecream » Tue Jun 30, 2015 8:15 am

Thank you Narcis!
I did this in the following way: set the Y axis to some default value and use automatic settings when values to display are not null.

Code: Select all

if (allNulls)
{
    Chart.Axes.Left.Automatic = false;
    Chart.Axes.Left.SetMinMax(0, m_barChartYMaximum);
}
else
{
    Chart.Axes.Left.Automatic = true;
}

Post Reply