When having multiple axis, is it possible to change scrollbar axis-location?

5 posts, 0 answers
  1. Unisense
    Unisense avatar
    34 posts
    Member since:
    Sep 2012

    Posted 02 Apr 2014 Link to this post

    Hi Telerik,

    I am using the RadCartesianChart and i have 3 axes. 2 Vertical, 1 Horizontal. 

    The problem is that the vertical scrollbar appears on the top vertical axis of the graph and i want it to appear on the bottom vertical axis. See attached image.

    I have searched forums in here but havent found someone in similar situation.

    So how would i achieve this? :)

    Best regards,
    Jeppe
  2. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 02 Apr 2014 Link to this post

    Hello Jeppe,

    The chart view only shows the slider (PanZoomBar) to the main HorizontalAxis of the chart. So you need to simply swap the axes.

    Right now you have set the HorizontalAxis property of the RadCartesianChart. This is the axis that will have a PanZoomBar. The other axis you have set to some series' HorizontalAxis property. So, one solution would be to swap the axes, or to change the VerticalLocation property of both axes. Let me know how it goes.

    Regards,
    Petar Marchev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Unisense
    Unisense avatar
    34 posts
    Member since:
    Sep 2012

    Posted 03 Apr 2014 in reply to Petar Marchev Link to this post

    Hi Petar,

    Thanks for the reply. I have tried it out.

    The additinal vertical axis is defined like this:
    <telerik:RadCartesianChart.Resources>
        <telerik:LinearAxis Title="Rate (nmol cm-3 s-1)" VerticalLocation="Top" x:Key="additionalHorizontalAxis" Name="additionalAxis"/>
    </telerik:RadCartesianChart.Resources>

    On the image attached you can see some rectangles on the graph.

    Before these rectangles used the main horizontal Axis(and now they are going to use the additional vertical axis). They are defined in the code behind like below:
    CartesianMarkedZoneAnnotation ann = new CartesianMarkedZoneAnnotation();
     
    ann.HorizontalFrom = areaData.X1;
    ann.HorizontalTo = areaData.X3;
    ann.VerticalFrom = areaData.Y3;
    ann.VerticalTo = areaData.Y1;
    ann.Fill = Brushes.ForestGreen;
    ann.Opacity = 0.4;
     
    lineSeries.Annotations.Add(ann);


    Dont know if this is a stupid question :) But how would i apply the above additional vertical axis to these rectangles(CartesianMarkedZoneAnnotation)?

    I cant do this 'ann.HorizontalAxis = additionalAxis' because the compiler cannot resolve the symbol 'additionalAxis'.

    Best regards,
    Jeppe



  5. Unisense
    Unisense avatar
    34 posts
    Member since:
    Sep 2012

    Posted 03 Apr 2014 in reply to Unisense Link to this post

    EDIT: Sorry but i can see that i mix horizontal and vertical axes. But so you dont get confused, this is only about the horizontal axes.

    So before when i wrote: "Before these rectangles used the main horizontal Axis(and now they are going to use the additional vertical axis)" I meant: "Before these rectangles used the main horizontal Axis(and now they are going to use the additional horizontal axis)"

    Sorry about mixing vertical and horizontal axes :)
  6. Unisense
    Unisense avatar
    34 posts
    Member since:
    Sep 2012

    Posted 03 Apr 2014 in reply to Unisense Link to this post

    Hi Petar,

    Thanks for suggesting this solution - it works now. I simply did:

    CartesianAxis Haxis = new LinearAxis();
    Haxis.Title = "Rate (nmol cm-3 s-1)";
    Haxis.VerticalLocation = AxisVerticalLocation.Top;

    ...

    CartesianMarkedZoneAnnotation ann = new CartesianMarkedZoneAnnotation();
    ann.HorizontalAxis = Haxis;

    Works as i want it to, thanks :)

    Best regards,
    Jeppe

Back to Top
UI for WPF is Visual Studio 2017 Ready