Page 1 of 1
PolarBar bottom axis labels are misaligned.
Posted: Tue Mar 19, 2013 2:27 pm
by 15662162
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());
Re: PolarBar bottom axis labels are misaligned.
Posted: Tue Mar 19, 2013 3:14 pm
by 15662162
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.
Re: PolarBar bottom axis labels are misaligned.
Posted: Tue Mar 19, 2013 3:52 pm
by 10050769
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,
Re: PolarBar bottom axis labels are misaligned.
Posted: Tue Mar 19, 2013 5:07 pm
by 15662162
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.
Re: PolarBar bottom axis labels are misaligned.
Posted: Wed Mar 20, 2013 1:54 pm
by 15662162
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.
Re: PolarBar bottom axis labels are misaligned.
Posted: Wed Mar 20, 2013 3:18 pm
by 10050769
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,