TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
-
icecream
- Newbie

- Posts: 20
- Joined: Thu Aug 07, 2008 12:00 am
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:
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

- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
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.
-
icecream
- Newbie

- Posts: 20
- Joined: Thu Aug 07, 2008 12:00 am
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.
-
icecream
- Newbie

- Posts: 20
- Joined: Thu Aug 07, 2008 12:00 am
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;
}