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

RadCartesianChart Questions

2 Answers 107 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Willem
Top achievements
Rank 1
Willem asked on 11 Jan 2013, 06:23 AM
Hi,

I am currently moving a chart from RadChart to RadCartesian chart due to performance issues.  I am facing some issues in replicating some of the features available in RadChart.  Could you please advise how I can do the following :

1) I want the vertical axis to display on the left and right of the chart.  Currently I am adding series programatically and the only way I have found to do this is to define the left axis in xaml and redefine the right axis on the first series I add,  this method doesn't work if I only have 1 series however.  Then I have to use binding to keep the two axes in sync as I add more series.

Is there a simple way to do this?  Ideally the options for HorizontalPlacement should be Left, Right, Both.

2) With RadChart I could add a sloping straight line using CustomLine in the chart annotations, specifying YIntercept and Slope.  Although I can add a CartesianCustomAnnotation in RadCartesianChart and can position the start of the line correctly relative to the underlying plot area, I cannot determine how to set the end point of the line as the X and Y values are relative to the CustomAnnotation Canvas not the plotted chart.

This question was also asked in the post below but was answered with CartesianGridAnnotation which only provides a solution for a straight line with no slope to my knowledge.

http://www.telerik.com/community/forums/silverlight/chart/cartesian-chart-without-adding-new-axis-for-custom-line.aspx

Below is my xaml for the custom annotation
<telerik:CartesianCustomAnnotation
     HorizontalValue="{Binding DriftLineStartDate}"
     VerticalValue="{Binding DriftLineStartValue}"
     HorizontalAxis="{Binding ElementName=HorizontalAxis}"
     VerticalAxis="{Binding ElementName=VerticalAxis}"
     ClipToPlotArea="True">
     <telerik:CartesianCustomAnnotation.Content>
             <Line StrokeThickness="1"
                 Stroke="Black"
                 X1="0"
                 Y1="0"
                 X2 ="{Binding DriftLineX2}"
                 Y2 ="{Binding DriftLineY2}"/>
     </telerik:CartesianCustomAnnotation.Content>
 </telerik:CartesianCustomAnnotation>



2 Answers, 1 is accepted

Sort by
0
Petar Kirov
Telerik team
answered on 15 Jan 2013, 07:04 PM
Hello Willem,

Let me address your questions one by one:

1) Currently there is no easy way to achieve this. You can add a place holder series with one data point - PlotInfo { XVal = i, YVal = null } (so that it is not visualized) which will work with the additional axis. You can use the DataBindingComplete of the rest of the series to update the axis Minimum and Maximum in code, when this is required.

2) You can consider using a LineSeries with two data points to emulate a CustomLine annotation. That way you can specify the start and end point in chart coordinates.

I have forwarded your feature requests to our development team and have logged them in our Public Issue Tracker on these two links - feature 1, feature 2
 
Regards,
Petar Kirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Willem
Top achievements
Rank 1
answered on 17 Jan 2013, 12:20 AM
Hi Petar,

Thanks for you reply.

1) I have attached my extra axis to the custom line mentioned in point 2 as a work around. 
2) Thanks for this suggestion,  worked perfectly!

Regards

Willem
Tags
Chart
Asked by
Willem
Top achievements
Rank 1
Answers by
Petar Kirov
Telerik team
Willem
Top achievements
Rank 1
Share this question
or