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);
}
}
Polar series's ClockWiseLabels
-
- Newbie
- Posts: 34
- Joined: Thu Sep 04, 2008 12:00 am
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Christo,
No, the correct one is setting ClockWiseLabels after adding data because setting ClockWiseLabels to true modifies data accordingly:
No, the correct one is setting ClockWiseLabels after adding data because setting ClockWiseLabels to true modifies data accordingly:
Code: Select all
public bool ClockWiseLabels
{
get { return clockWiseLabels; }
set
{
SetBooleanProperty(ref clockWiseLabels, value);
ModifyData();
}
}
private void ModifyData()
{
for (int i = 0; i < XValues.Count; i++)
{
XValues[i] = 360 - XValues[i];
}
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 34
- Joined: Thu Sep 04, 2008 12:00 am
If I've got code which does:
polar.ClockWiseLabels = true;
polar.ClockWiseLabels = true;
polar.ClockWiseLabels = true;
polar.ClockWiseLabels = true;
...
The data get transformed everytime! We are therefore never guaranteed that the state of the ClockWiseLabels is in anyway consistent with the data. The order sensitivity of calls will be a major issue for us in the future if we want to optimise for performance.
Could you add to your wish list that this could gets reworked/cleaned up/fixed?
polar.ClockWiseLabels = true;
polar.ClockWiseLabels = true;
polar.ClockWiseLabels = true;
polar.ClockWiseLabels = true;
...
The data get transformed everytime! We are therefore never guaranteed that the state of the ClockWiseLabels is in anyway consistent with the data. The order sensitivity of calls will be a major issue for us in the future if we want to optimise for performance.
Could you add to your wish list that this could gets reworked/cleaned up/fixed?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Christo,
Yes, I agree this may need to be redesigned. I've added your request to the wish-list.
Yes, I agree this may need to be redesigned. I've added your request to the wish-list.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |