Page 1 of 1

Changing AngleIncrement has no effect

Posted: Thu Mar 05, 2009 2:05 pm
by 13050248
I'm using TeeChart.WPF 3.5.3317.17532.

It seems that AngleIncrement doesn't have any effect anymore.

I've set it quite large, but to no avail.
series.AngleIncrement = 90; // 90 degrees increments


<Window x:Class="WPFDemo.Window5"
xmlns="http://schemas.microsoft.com/winfx/2006 ... esentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:WPF="clr-namespace:Steema.TeeChart.WPF;assembly=TeeChart.WPF"
Title="Window5" Height="600" Width="800">
<WPF:TChart Grid.Row="1" x:Name="chart"/>
</Window>

public partial class Window5
{
public Window5()
{
InitializeComponent();
chart.SnapsToDevicePixels = true;
chart.Aspect.View3D = false;
chart.Axes.Left.Automatic = false;
chart.Axes.Left.AutomaticMinimum = false;
chart.Axes.Left.AutomaticMaximum = false;
chart.Axes.Left.Minimum = 0;
chart.Axes.Left.Maximum = 1;

Polar series = new Polar();
series.CircleLabels = true;
series.Circled = true;
series.AngleIncrement = 90; // 90 degrees increments
series.Add(0, 1.0 / Math.Sqrt(2));
series.Add(45, 1);

chart.Series.Add(series);
}
}

Posted: Thu Mar 05, 2009 3:45 pm
by narcis
Hi Christo,

It works fine adding Polar series to the chart like this:

Code: Select all

			Polar series = new Polar(chart.Chart);
For example:

Code: Select all

		public void initChart4(TChart chart, Label label)
		{
			setupChart(chart);
			label.Content = "BEFORE adding data:\nseries.ClockWiseLabels = true;";

			Polar series = new Polar(chart.Chart);
			setupPolar(series);

			series.RotationAngle = 90;
			series.ClockWiseLabels = true;

			series.Add(0, 1.0 / Math.Sqrt(2));
			series.Add(45, 1);

			//chart.Series.Add(series);
		}

Posted: Fri Mar 06, 2009 6:26 am
by 13050248
Setting series.AngleIncrement after chart.Series.Add(series) seems to work.

Is this the general philosophy? Should I always apply settings after the series was added to the chart or should I test settings case by case?

Posted: Fri Mar 06, 2009 11:04 am
by narcis
Hi Christo,

No, this is a particular case. AngleIncrement sets series' GetHorizAxis.Increment property. Since this axis doesn't exist in the chart as no series has been added to the chart it doesn't work. That's the reason why you need to add the series to the chart before setting this property. Both options below work fine:

Code: Select all

			Steema.TeeChart.Styles.Polar polar1 = new Steema.TeeChart.Styles.Polar(tChart1.Chart);

			polar1.AngleIncrement = 30;
			polar1.FillSampleValues();			

Code: Select all

			Steema.TeeChart.Styles.Polar polar1 = new Steema.TeeChart.Styles.Polar();
			tChart1.Series.Add(polar1);

			polar1.AngleIncrement = 30;
			polar1.FillSampleValues();