3D bar chart rotation

4 posts, 0 answers
  1. Gunnar
    Gunnar avatar
    28 posts
    Member since:
    Aug 2009

    Posted 15 Jul 2011 Link to this post

    The example for 3D Bar Chart has the ability to rotate by clicking on the chart area and move the mouse.
    I have tried to copy most parts of the Example chart xaml code and adapted in to my needs. I can get everything to work as expected, but I can't get it to react to mouse movement and rotate.
    Is something else than what is shown by the example code needed to implement this?
  2. Missing user
    Missing user avatar

    Posted 20 Jul 2011 Link to this post

    Hi Gunnar,

    I prepared a sample project that demonstrates how to implement 3D Bar RadChart control. You can find it in the attached file. In order to be able to rotate the chart, you need to use CameraExtension:
    <telerik:RadChart x:Name="RadChart1">
        <telerik:RadChart.DefaultSeriesDefinition>
            <telerik:Bar3DSeriesDefinition />
        </telerik:RadChart.DefaultSeriesDefinition>
     
        <telerik:RadChart.DefaultView>
            <telerik:ChartDefaultView>
                <telerik:ChartDefaultView.ChartArea>
                    <telerik:ChartArea>
                        <telerik:ChartArea.Extensions>
                            <telerik:CameraExtension />
                        </telerik:ChartArea.Extensions>
                    </telerik:ChartArea>
                </telerik:ChartDefaultView.ChartArea>
            </telerik:ChartDefaultView>
        </telerik:RadChart.DefaultView>
    </telerik:RadChart>

    I hope that this helps.

    All the best,
    Polina
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. Gunnar
    Gunnar avatar
    28 posts
    Member since:
    Aug 2009

    Posted 20 Jul 2011 Link to this post

    Hi,

    I copied the code from the Silverlight demo project letter by letter. It has a ChartLegend section but otherwise it is identical to the code you propose.

    <telerik:RadChart x:Name="RadChart1" ItemsSource="{Binding ElementName=certificatesAndIncidentsPerTemplateDomainDataSource, Path=Data}">
        <telerik:RadChart.DefaultSeriesDefinition>
            <telerik:Bar3DSeriesDefinition />
        </telerik:RadChart.DefaultSeriesDefinition>
     
        <telerik:RadChart.DefaultView>
            <telerik:ChartDefaultView>
                <telerik:ChartDefaultView.ChartLegend>
                    <telerik:ChartLegend Name="legend" />
                </telerik:ChartDefaultView.ChartLegend>
                <telerik:ChartDefaultView.ChartArea>
                    <telerik:ChartArea LegendName="legend">
                        <telerik:ChartArea.Extensions>
                            <telerik:CameraExtension />
                        </telerik:ChartArea.Extensions>
                    </telerik:ChartArea>
                </telerik:ChartDefaultView.ChartArea>
            </telerik:ChartDefaultView>
        </telerik:RadChart.DefaultView>
    </telerik:RadChart>

    The CameraExtension section is present. When this code is run in the Silverlight example project it works. When the exact same code run in my project it doesn't work (no reaction whatsoever when I click/drag with the mouse on the chart).

    One difference is that in the Silverlight sample code, the chart is the root control of a UserControl - in my code the same chart object is placed in a grid on a navigationpage. Does this matter?
  4. Peshito
    Admin
    Peshito avatar
    585 posts

    Posted 25 Jul 2011 Link to this post

    Hello Gunnar,

    Please, take a look at the same edited project that I've attached. I've included the chart in a Navigation page and it works just fine.

    Hope that helps in solving the issue.

    Regards,
    Peshito
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top