Previous Next

Thread: Any way to get 45 degree angle in chart?

Last post 08-10-2008 4:21 PM by swobi. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 04-06-2007, 5:56 PM

    Any way to get 45 degree angle in chart?

    i got just about everything else i need, but just cannot figure out how to get a 45 degree angle for my x axis time labels using a config script .


    anyone?
  • 08-06-2008, 9:44 AM In reply to

    Re: Any way to get 45 degree angle in chart?

    i am not sure if this is what you are looking for but to get a 45 degree angle is 3 lines of a triangle that are the exact length and connected

    steve

  • 08-10-2008, 4:21 PM In reply to

    • swobi
    • Top 500 Contributor
    • Joined on 04-06-2007, 8:03 PM
    • Posts 10

    Re: Any way to get 45 degree angle in chart?

    Hi there!

    I think I figured out what jake20 (the original poster) wants.

    In Excel you can change the orientation of the axis labels, so when your labels are quite long they don't overlap. Actually Excel seems to do this on its own, when there's not enough space and uses a default 45 degree angle.

    Alas what OWC does in this case is rotate the labels 90 degrees.

    You can change this behaviour with a config script

    chconst = chartSpace.Constants;
    chart.Axes(0).Orientation = chconst.chLabelOrientationUpward;

    but there are only the following values available:

    constant                                 value
    chLabelOrientationAutomatic    1000
    chLabelOrientationDownward      -90
    chLabelOrientationHorizontal         0
    chLabelOrientationUpward           90

    I tried a little hack ;-)

    chart.Axes(0).Orientation = 45;

    but only got "Error executing script at line 1: Invalid Parameter"

    I also found an intersting article (http://microsoft.apress.com/asptodayarchive/71730/multiple-thread-techniques-for-a-c-windows-service) stating the same fact:

    [...] 
    Defining the Text Orientation of Labels

    You now have the ability to specify the orientation of the text of your labels on both the x and y-axis. This feature really helps with dates. However, you are limited to only 4 options:

    • chLabelOrientationAutomatic
    • chLabelOrientationDownward
    • chLabelOrientationHorizontal
    • chLabelOrientationUpward

    [...]

    So the answer is sadly "No, it's not possible!"

    Thanks for this interesting question, it was an intriguing journey ;-)
        swobi

     

Page 1 of 1 (3 items)
Page view counter