I am able to get the Mockup using CandleStick chart.. Please look into the attached Screenshot.
Can somebody help me in solving the below 2 issues..
1. I have to display the "HighValue" and "LowValue" at the top and bottom of every item as in the mockup.
2. Using Annotation, I have drawn a line at the value of "13" and i have named the Label as "BASE VALUE".
I want that label to be displayed outside the graph as in the mockup.
<
telerik:RadCartesianChart
x:Name
=
"xCartesianChart"
Height
=
"300"
Width
=
"400"
Palette
=
"Windows8"
>
<
telerik:RadCartesianChart.VerticalAxis
>
<
telerik:LinearAxis
x:Name
=
"verticalAxis"
HorizontalLocation
=
"Left"
/>
</
telerik:RadCartesianChart.VerticalAxis
>
<
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:CategoricalAxis
VerticalLocation
=
"Top"
LineThickness
=
"1"
LabelInterval
=
"2"
ShowLabels
=
"True"
/>
</
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:CandlestickSeries
x:Name
=
"xCandleStick"
CategoryBinding
=
"XValue"
LowBinding
=
"YValue2"
HighBinding
=
"YValue"
CloseBinding
=
"YValue2"
OpenBinding
=
"YValue"
ShowLabels
=
"True"
/>
<
telerik:RadCartesianChart.Annotations
>
<
telerik:CartesianGridLineAnnotation
Axis
=
"{Binding ElementName=verticalAxis}"
Label
=
"BASE VALUE"
Value
=
"13"
Stroke
=
"Green"
>
<
telerik:CartesianGridLineAnnotation.LabelDefinition
>
<
telerik:ChartAnnotationLabelDefinition
Location
=
"Left"
VerticalAlignment
=
"Top"
VerticalOffset
=
"0"
HorizontalOffset
=
"80"
/>
</
telerik:CartesianGridLineAnnotation.LabelDefinition
>
</
telerik:CartesianGridLineAnnotation
>
</
telerik:RadCartesianChart.Annotations
>
</
telerik:RadCartesianChart
>
//Code-behind
public
MainWindow()
{
InitializeComponent();
PopulateCartesianChart();
}
void
PopulateCartesianChart()
{
Random rnd =
new
Random();
List<ChartDataClass> chartDatas =
new
List<ChartDataClass>();
for
(
int
i = 0; i < 20; i++)
{
ChartDataClass cdc =
new
ChartDataClass();
cdc.XValue = i;
cdc.YValue = rnd.NextDouble() * 100;
cdc.YValue2 = cdc.YValue - 50;
chartDatas.Add(cdc);
}
xCartesianChart.Series[0].ItemsSource = chartDatas;
}
Thanks in Advance :)