none
How to rotate a chart around the X axis and Y axis?

    Question

  • I want to rotate a chart around the x axis and y axis, but somehow I'm only able to rotate the chart around the y-axis.

    I use the following code ( This is a piece of code from the vb.net 200 interactive chart examples).

    ' Set the X Angle to 30
    chart1.ChartAreas("Default").Area3DStyle.Rotation = 30
            
    ' Set the Y Angle to 40
    chart1.ChartAreas("Default").Area3DStyle.Rotation = 40

    Somehow the first piece of code should turn the chart on the x-axis and the second piece of code around the y-axis. But somehow the pieces of code look exactly the same, and i'm not able to specify on which axis the chart should be rotated.

    I can now only return the chart around the y-axis but not the x axis.  I also read this...: 

    Charts can be rotated horizontally and vertically from -90 to 90 degrees. A positive horizontal angle will rotate the chart counter-clockwise around the x-axis, while a positive vertical angle will rotate the chart clockwise around the y-axis.

    ....which I found here:

    http://msdn.microsoft.com/en-us/library/dd207035.aspx

    But what exactly do they mean with a positive horizontal angle and a positive vertical angle?

    Maybe a positive vertical angle = 45 to 90 degrees, and a positive horizontal angle is from 0 to 45 degrees. If so this doesn't seem to work.

    Thanks in advance!




    • Edited by loi-se Friday, February 22, 2013 1:19 PM
    Friday, February 22, 2013 1:18 PM

Answers

  • I already found the answer. To rotate around the Y-axis use:

    Chart1.ChartAreas("ChartArea1").Area3DStyle.Rotation = X

    And to return around the X-axis use:

       Chart1.ChartAreas("ChartArea1").Area3DStyle.Inclination = X

    The documentation I used wasn't mentioning it properly.

    • Marked as answer by loi-se Friday, February 22, 2013 7:18 PM
    Friday, February 22, 2013 7:18 PM