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

Rotating Charts/Camera Extension

5 Answers 96 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Richard Alvarez
Top achievements
Rank 1
Richard Alvarez asked on 19 Apr 2011, 12:27 AM
I can't find any documentation on how to set the view angle of a 3d chart to anything but the default.  I saw something that suggested I could use the new camera extension, but I can't find any documentation on it.

5 Answers, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 21 Apr 2011, 12:25 PM
Hi Richard Alvarez,
Please, have a look at our Flexible API demo example - http://demos.telerik.com/silverlight/#Chart/FlexibleAPI, which demonstrates how to enable the CameraExtension when switching to a 3D series.

You can find another, very simple project that demonstrates the same, attached to the last post in the following forum thread - http://www.telerik.com/community/forums/wpf/chart/adding-camera-extension-gives-error-of-object-reference-not-set-to-an-instance-of-object.aspx.

You can use the CameraExtension API -- methods like Zoom, RotateX, RotateY, RotateZ, RotateXY etc. to change the default view angle of a 3D chart. For example:
(this.RadChart1.DefaultView.ChartArea.Extensions[0] as CameraExtension).RotateX(30);

Kind regards,
Tsvetie
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
0
Richard Alvarez
Top achievements
Rank 1
answered on 27 Apr 2011, 06:06 PM
The demo link doesn't show me any code-behind.  Just adding the camera extension in the xaml doesn't do anything for me.

I can't get the other project to run.  The page never loads, just locks up.
0
Tsvetie
Telerik team
answered on 02 May 2011, 05:04 PM
Hi Richard Alvarez,
In order to see the code of the demo, you just need to click the "Code" tab (in the upper right corner of the demo).

Regarding the demo project, attached to the other forum thread that I mentioned - I did not have problems running the demo without any modifications. Could you please make sure that you are using the same version (2010.3.1304.35) or later of RadChart for Silverlight?

In case the problem persists, please open a formal support ticket and send me a running test project that demonstrates your setup. Once I have this project, I will be able to provide you with more concrete information on how to configure your chart control.

Kind regards,
Tsvetie
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
0
Richard Alvarez
Top achievements
Rank 1
answered on 02 May 2011, 11:05 PM
I rebooted after installing the Silverlight 5 beta, and the WPF project worked.  I don't know why.

Anyway, I was able to then rotate the chart in the code-behind before the page was fully rendered.

However, my real goal was to then render the chart as an image, using ExportToImage.  I moved the rotation into the dispatcher where I run ExportToImage, but the export unfortunately renders the non-rotated version of the chart only.
0
Tsvetie
Telerik team
answered on 05 May 2011, 02:04 PM
Hi Richard Alvarez,
I updated slightly the demo project to test the ExportToImage method of RadChart and the image I got represented the rotated chart. Have a look at the code I used for my test:
private void ExportButton_Click(object sender, RoutedEventArgs e)
{
    (this.RadChart1.DefaultView.ChartArea.Extensions[0] as CameraExtension).RotateX(30);
 
    SaveFileDialog dialog = new SaveFileDialog();
    dialog.DefaultExt = "png";
    dialog.Filter = "*.png | PNG";
    if (!(bool)dialog.ShowDialog())
        return;
 
    Stream fileStream = dialog.OpenFile();
    this.RadChart1.ExportToImage(fileStream);
    fileStream.Close();
}

In case this does not help you, please send us a running test project that demonstrates the problem.

All the best,
Tsvetie
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
Richard Alvarez
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Richard Alvarez
Top achievements
Rank 1
Share this question
or