How to get counts of breaks on each axis?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Oli
Newbie
Newbie
Posts: 42
Joined: Fri Jan 13, 2012 12:00 am

How to get counts of breaks on each axis?

Post by Oli » Tue Feb 07, 2012 11:22 pm

Hi,

I would like to get the counts of breaks on each axis (bottom, left, and right). I think the following code gives me the total number of breaks, but is there an easy way to find out to which axis each break belongs too?

Dim axisbreak As Steema.TeeChart.Tools.AxisBreaksTool = New Steema.TeeChart.Tools.AxisBreaksTool(tChart.Chart)
Dim NumBreaks as integer
NumBreaks=axisbreak.Breaks.Count



Oliver

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: How to get counts of breaks on each axis?

Post by Sandra » Thu Feb 09, 2012 4:51 pm

Hello Oliver,

The way as you get the number of AxisBreak are you add in your Chart is correct and If I had to suggest you a way to count the number of breaks, I would recommend the code you attached in your post.

Thanks,
Best Regards,
Sandra Pazos / 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

Oli
Newbie
Newbie
Posts: 42
Joined: Fri Jan 13, 2012 12:00 am

Re: How to get counts of breaks on each axis?

Post by Oli » Thu Feb 09, 2012 11:21 pm

Thanks Sandra,

I have overseen the properties axisbreak.Axis=tchart.Axes.Bottom
Onebreak.PNG
Onebreak.PNG (18.49 KiB) Viewed 9901 times
to link the breaks to an axis

However, unfortunately I have other problems with the axis breaks using Teechart pro V2011 (4.1.2012.1032). All problems occur with charts produced with the Teechart assemblies (without DewResearch).

First, adding two breaks in a single axis causes the axis to be drawn through the first gap of the breaks. See attachements.

Onebreak.PNG
Onebreak.PNG (18.49 KiB) Viewed 9901 times
Twobreaks.PNG
Twobreaks.PNG (20.53 KiB) Viewed 9908 times


Secondly, I can not load charts as native format if the chart contains axis breaks. The following exception occur. The code works fine for charts not having any breaks.

LoadingChartwithBreaks.PNG
LoadingChartwithBreaks.PNG (60.42 KiB) Viewed 9906 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: How to get counts of breaks on each axis?

Post by Sandra » Fri Feb 10, 2012 4:01 pm

Hello Oli,
First, adding two breaks in a single axis causes the axis to be drawn through the first gap of the breaks.
Next code works fine for me in last version of TeeChartFor.Net 2012:

Code: Select all

       private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            //InitializeChart.
            tChart1.Series.Clear();
            Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
            
            line1.FillSampleValues(20);
            //AxesBreaks. 
            Steema.TeeChart.Tools.AxisBreaksTool axisbreak = new Steema.TeeChart.Tools.AxisBreaksTool(tChart1.Chart);
            Steema.TeeChart.Tools.AxisBreak axisBreak1 = new Steema.TeeChart.Tools.AxisBreak(axisbreak);
            Steema.TeeChart.Tools.AxisBreak axisBreak2 = new Steema.TeeChart.Tools.AxisBreak(axisbreak);
            axisBreak1.StartValue = 4;
            axisBreak1.EndValue = 6;
            axisBreak2.StartValue = 15;
            axisBreak2.EndValue = 17; 
            axisbreak.Axis = tChart1.Axes.Bottom;
            axisbreak.GapSize = 20;
        }
Can you please try if previous code works as you expect?
Secondly, I can not load charts as native format if the chart contains axis breaks. The following exception occur. The code works fine for charts not having any breaks.
I have added it in wish-list with number [TF02016030] to be consider it inclusion in next maintenance releases of TeeChart.Net.

Thanks,
Best Regards,
Sandra Pazos / 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

Oli
Newbie
Newbie
Posts: 42
Joined: Fri Jan 13, 2012 12:00 am

Re: How to get counts of breaks on each axis?

Post by Oli » Fri Feb 10, 2012 10:23 pm

Hi Sandra,

regarding the axis drawn through the gap, the your code does not resolve the problem, and is equavalent to the code I am using. You said you are using Teechart.Net V2012, but I checked the download page under Client access and the latest version available for download is TeeChartNET2011_4.1.2012.01030. So I am a little confused, and I would appreciate if you can confirm that you have used another version. If that is the case, how to download the latest version Teechart.net V2012?


Thanks for adding the issue with loading charts containing axis breaks on the wish list. But I think it should go on the bug list...it causes an exception, and makes the use of the binary format rather limited if I rely on axis breaks. I need also to use the binary format to save and load chart for later editing. So I would appreciate if this can be handled with a higher priority rather being on the wish list. I would appreciate the efforts.

Oliver

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: How to get counts of breaks on each axis?

Post by Sandra » Tue Feb 14, 2012 4:11 pm

Hi Oli,
regarding the axis drawn through the gap, the your code does not resolve the problem, and is equavalent to the code I am using. You said you are using Teechart.Net V2012, but I checked the download page under Client access and the latest version available for download is TeeChartNET2011_4.1.2012.01030. So I am a little confused, and I would appreciate if you can confirm that you have used another version. If that is the case, how to download the latest version Teechart.net V2012?
Sorry, for the confusion. The last V2012 is build 4.1.2012.01030, therefore, you can use the last version of TeeChart.Net.

Thanks,
Best Regards,
Sandra Pazos / 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

Oli
Newbie
Newbie
Posts: 42
Joined: Fri Jan 13, 2012 12:00 am

Re: How to get counts of breaks on each axis?

Post by Oli » Sun Mar 18, 2012 10:46 am

Hi Sandra,

loading charts with axis breaks from the binary format works now with the latest version Teechart2012 4.1.2012.2282 ...thank you very much.

Oli

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: How to get counts of breaks on each axis?

Post by Sandra » Mon Mar 19, 2012 10:01 am

Hello Oli,

I am glad that your problem have solved in last version of TeeChartFor.Net. :)

Thanks,
Best Regards,
Sandra Pazos / 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

Post Reply