Polar series's ClockWiseLabels
Posted: Thu Mar 05, 2009 7:24 am
Hi
Why does the order of setting ClockWiseLabels and adding the series data affect the output?
Shouldn't case 4 & 5 give the same plot?
(case 4)
BEFORE adding data:
series.ClockWiseLabels = true;
(case 5)
AFTER adding data:
series.ClockWiseLabels = true;
<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">
<TabControl>
<TabItem Header="4">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Label Grid.Row="0" x:Name="m_Label4"/>
<WPF:TChart Grid.Row="1" x:Name="m_Chart4"/>
</Grid>
</TabItem>
<TabItem Header="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Label Grid.Row="0" x:Name="m_Label5"/>
<WPF:TChart Grid.Row="1" x:Name="m_Chart5"/>
</Grid>
</TabItem>
</Window>
public partial class Window5
{
public Window5()
{
InitializeComponent();
initChart4(m_Chart4, m_Label4);
initChart5(m_Chart5, m_Label5);
}
public void setupChart(TChart chart)
{
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;
}
public void setupPolar(Polar series)
{
series.CircleLabels = true;
series.Circled = true;
series.AngleIncrement = 30; // 30 degrees increments
}
public void initChart4(TChart chart, Label label)
{
setupChart(chart);
label.Content = "BEFORE adding data:\nseries.ClockWiseLabels = true;";
Polar series = new Polar();
setupPolar(series);
series.RotationAngle = 90;
series.ClockWiseLabels = true;
series.Add(0, 1.0 / Math.Sqrt(2));
series.Add(45, 1);
chart.Series.Add(series);
}
public void initChart5(TChart chart, Label label)
{
setupChart(chart);
label.Content = "AFTER adding data:\nseries.ClockWiseLabels = true;";
Polar series = new Polar();
setupPolar(series);
series.RotationAngle = 90;
series.Add(0, 1.0 / Math.Sqrt(2));
series.Add(45, 1);
series.ClockWiseLabels = true;
chart.Series.Add(series);
}
}
Why does the order of setting ClockWiseLabels and adding the series data affect the output?
Shouldn't case 4 & 5 give the same plot?
(case 4)
BEFORE adding data:
series.ClockWiseLabels = true;
(case 5)
AFTER adding data:
series.ClockWiseLabels = true;
<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">
<TabControl>
<TabItem Header="4">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Label Grid.Row="0" x:Name="m_Label4"/>
<WPF:TChart Grid.Row="1" x:Name="m_Chart4"/>
</Grid>
</TabItem>
<TabItem Header="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Label Grid.Row="0" x:Name="m_Label5"/>
<WPF:TChart Grid.Row="1" x:Name="m_Chart5"/>
</Grid>
</TabItem>
</Window>
public partial class Window5
{
public Window5()
{
InitializeComponent();
initChart4(m_Chart4, m_Label4);
initChart5(m_Chart5, m_Label5);
}
public void setupChart(TChart chart)
{
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;
}
public void setupPolar(Polar series)
{
series.CircleLabels = true;
series.Circled = true;
series.AngleIncrement = 30; // 30 degrees increments
}
public void initChart4(TChart chart, Label label)
{
setupChart(chart);
label.Content = "BEFORE adding data:\nseries.ClockWiseLabels = true;";
Polar series = new Polar();
setupPolar(series);
series.RotationAngle = 90;
series.ClockWiseLabels = true;
series.Add(0, 1.0 / Math.Sqrt(2));
series.Add(45, 1);
chart.Series.Add(series);
}
public void initChart5(TChart chart, Label label)
{
setupChart(chart);
label.Content = "AFTER adding data:\nseries.ClockWiseLabels = true;";
Polar series = new Polar();
setupPolar(series);
series.RotationAngle = 90;
series.Add(0, 1.0 / Math.Sqrt(2));
series.Add(45, 1);
series.ClockWiseLabels = true;
chart.Series.Add(series);
}
}