PolarBar bottom axis labels are misaligned.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Pete
Newbie
Newbie
Posts: 8
Joined: Wed Apr 11, 2012 12:00 am

PolarBar bottom axis labels are misaligned.

Post by Pete » Tue Mar 19, 2013 2:27 pm

I have a PolarBar chart and it appears that the labels on the bottom axis aren't aligned with the corresponding "ring". in the attached picture, if you look at the 0.65 ring, it lines up with the left, top, and right labels, but not with the bottom.

we are using TChart version 4.1.2011.4193. is this a bug? if so, has it been corrected in a more recent release?

i have gotten around this by using the following code right after adding the series to the chart.
ISOCntrAngleChart.Axes.Left.SetMinMax(ISOCntrAngleChart[0].MinYValue(), ISOCntrAngleChart[0].MaxYValue());
ISOCntrAngleChart.Axes.Right.SetMinMax(ISOCntrAngleChart[0].MinYValue(), ISOCntrAngleChart[0].MaxYValue());
ISOCntrAngleChart.Axes.Top.SetMinMax(ISOCntrAngleChart[0].MinYValue(), ISOCntrAngleChart[0].MaxYValue());
ISOCntrAngleChart.Axes.Bottom.SetMinMax(ISOCntrAngleChart[0].MinYValue(), ISOCntrAngleChart[0].MaxYValue());
Attachments
polar chart labels.jpg
polar chart labels.jpg (67.9 KiB) Viewed 6956 times

Pete
Newbie
Newbie
Posts: 8
Joined: Wed Apr 11, 2012 12:00 am

Re: PolarBar bottom axis labels are misaligned.

Post by Pete » Tue Mar 19, 2013 3:14 pm

after a bunch of experimentation, it turns out that i only need to set the Min/Max of the Left and Bottom. Left uses Min/Max Y and Bottom uses Min/Max X.

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

Re: PolarBar bottom axis labels are misaligned.

Post by Sandra » Tue Mar 19, 2013 3:52 pm

Hello Pete,

Using next code in last version of TeeChartFor.Net, your problem doesn't appear:

Code: Select all

        public Form1()
        {
            InitializeComponent();
            InitializeChart();
        }
        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;

            Steema.TeeChart.Styles.Polar polar1 = new Polar(tChart1.Chart);
            tChart1.Aspect.View3D = false;
            polar1.Circled = true;
            tChart1.Dock = DockStyle.Fill;

            polar1.Brush.Visible = false;
            polar1.Add(0, 0.65);
            polar1.Add(320, 0.58);
            polar1.Pen.Visible = false;
          
            polar1.ClockWiseLabels = true;
            polar1.RotationAngle = 90;

            tChart1.Axes.Left.SetMinMax(0, tChart1[0].MaxYValue()+0.1);
            tChart1.Axes.Right.SetMinMax(0, tChart1[0].MaxYValue()+0.1);
            tChart1.Axes.Top.SetMinMax(0, tChart1[0].MaxYValue()+0.1);
            tChart1.Axes.Bottom.SetMinMax(0, tChart1[0].MaxYValue()+0.1);
         
        }
Could you confirm us if your problem is solved using 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

Pete
Newbie
Newbie
Posts: 8
Joined: Wed Apr 11, 2012 12:00 am

Re: PolarBar bottom axis labels are misaligned.

Post by Pete » Tue Mar 19, 2013 5:07 pm

Hi Sandra,

I'm glad to see that it doesn't happen in the version you are using. unfortunately, this chart is embedded in a number of custom controls that we have as part of our solution, and, to change them out might be a bit of a challenge, as i didn't write any of the controls.

i would imagine that simply having the comment in the thread that this appears to have been resolved in the latest .NET version, might make a future code seeker feel better at ease.

if i do get a chance to test this, i will definitely post my results.

thanks,

pete.

Pete
Newbie
Newbie
Posts: 8
Joined: Wed Apr 11, 2012 12:00 am

Re: PolarBar bottom axis labels are misaligned.

Post by Pete » Wed Mar 20, 2013 1:54 pm

i'm not sure if it makes a difference, but the series we're adding to the chart is a PolarBar, not a plain "Polar" series.

below is the code ...

Steema.TeeChart.Styles.PolarBar PolarSeries = new Steema.TeeChart.Styles.PolarBar();
PolarSeries.Circled = true;
PolarSeries.Pen.Visible = false;
PolarSeries.Pointer.Pen.Color = Color.Aqua;
PolarSeries.Pointer.HorizSize = 2;
PolarSeries.Pointer.VertSize = 2;
PolarSeries.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Diamond;
PolarSeries.CircleLabels = true;
PolarSeries.CircleLabelsRotated = false;
PolarSeries.LabelsMargin = 1;
PolarSeries.RotationAngle = 90;

foreach (GantryBeamInfo rs in Results)
PolarSeries.Add(rs.BeamCalcAngle, rs.BeamDistance);

ISOCntrAngleChart.Series.Add(PolarSeries);

right after this is where i added the SetMinMax calls that correct the label behavior.

thanks,

pete.

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

Re: PolarBar bottom axis labels are misaligned.

Post by Sandra » Wed Mar 20, 2013 3:18 pm

Hello Pete,

The same code using a PolarBar works in correct way using last version:

Code: Select all

        public Form1()
        {
            InitializeComponent();
            InitializeChart();
        }
        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;

            Steema.TeeChart.Styles.PolarBar polar1 = new PolarBar(tChart1.Chart);
            tChart1.Aspect.View3D = false;
            polar1.Circled = true;
            tChart1.Dock = DockStyle.Fill;

            polar1.Brush.Visible = false;
            polar1.Add(0, 0.65);
            polar1.Add(320, 0.58);
            polar1.Pen.Visible = false;

            polar1.ClockWiseLabels = true;
            polar1.RotationAngle = 90;

            tChart1.Axes.Left.SetMinMax(0, tChart1[0].MaxYValue() + 0.1);
            tChart1.Axes.Right.SetMinMax(0, tChart1[0].MaxYValue() + 0.1);
            tChart1.Axes.Top.SetMinMax(0, tChart1[0].MaxYValue() + 0.1);
            tChart1.Axes.Bottom.SetMinMax(0, tChart1[0].MaxYValue() + 0.1);

        }
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