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

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

4 Answers 59 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Unisense
Top achievements
Rank 1
Unisense asked on 02 Apr 2014, 07:39 AM
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

4 Answers, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 02 Apr 2014, 05:29 PM
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.

 
0
Unisense
Top achievements
Rank 1
answered on 03 Apr 2014, 06:31 AM
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



0
Unisense
Top achievements
Rank 1
answered on 03 Apr 2014, 09:13 AM
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 :)
0
Unisense
Top achievements
Rank 1
answered on 03 Apr 2014, 10:00 AM
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

Tags
General Discussions
Asked by
Unisense
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Unisense
Top achievements
Rank 1
Share this question
or