This is a migrated thread and some comments may be shown as answers.

Colors Issue, Camera Extensions..

1 Answer 56 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Hash
Top achievements
Rank 1
Hash asked on 24 Jun 2011, 03:50 PM
I am using WPF Rad Pie Chart control
Here i have multiple problems..As per my requirement..

I need to display thress categories in Pie chart 
1. Incomplete
2. Complete
3. NotStarted

If the any <Category> records are 0 then we are not going to display that in the pie chart.. But i do want to display the legend.
So to achieve this, I am adding the Legend Item manually, Label and MarkerFill..

1) The problem is .. When i do not display a category.., the legend colors and Pie chart colors are not matching..  Can you please let me know a way to resolve this problems.. [--  FYI If i am displaying all the categories on the chart, then the colors Match]
2) If i do not use any camera extensions, by default the pie chart is at an angle of 60 degrees.. Which is not very visible to the user, How can i change the default angle so that it displays.. as a full circle..

Thanks for the Help..

1 Answer, 1 is accepted

Sort by
0
Sia
Telerik team
answered on 29 Jun 2011, 03:37 PM
Hello aslesh,

Straight to your questions:

1. I understand your problem and it is caused because the pie slices get their color depending on the number of slices ( the first color is set to the first slice, the second to the second one and so on).
A possible solution to overcome this is to use a custom delegate function where a specific color is set depending on some field. Please check this approach and let me know whether it is possible in your scenario.

2. I suppose that you use a 3D Pie series in your project. You can set the camera extension initially in your code as follows and clear it on the size changed event of RadChart if you do not want the user to be able to change the pie position after that:
public MainWindow()
        {
            InitializeComponent();
 
            CameraExtension c = new CameraExtension();
            c.RotateX(70);
            c.RotateY(-30);
 
            this.RadChart1.DefaultView.ChartArea.Extensions.Add(c);
            this.RadChart1.SizeChanged += new SizeChangedEventHandler(RadChart1_SizeChanged);
        }
 
        void RadChart1_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            this.RadChart1.DefaultView.ChartArea.Extensions.Clear();
        }
}
 
Best wishes,
Sia
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Chart
Asked by
Hash
Top achievements
Rank 1
Answers by
Sia
Telerik team
Share this question
or