I have two different questions, but because they are for one chart and therefore are somehow related i'm writting them in one thread. I'll deeply appreciate any help even for one of them.
1. How to create a shape in RadCartesianChart? I want to create a big circle which marks only the last point in chart. I'm trying to use AreaSeries but instead of drawing the form it fills the space from HorizontalAxis to vertical value of the point.
2. How to scale HorizontalAxis. I want horizontal axis to have minimum/maximum value just like the vertical axis, which is LinearAxis. When I use CategoricalAxis for HorizontalAxis the graphic is drawn but I cannot scale. If i replace CategoricalAxis with LinearAxis no needed graphic is drawed anymore, just empty Chart.
I use the following code:
this.AreaSeries = new AreaSeries(){};
this.LineSeries = new LineSeries(){};
this.LineSeries.CategoryBinding = new GenericDataPointBinding<Point, double>() { ValueSelector = (p) => p.X };
this.LineSeries.ValueBinding = new GenericDataPointBinding<Point, double>() { ValueSelector = (p) => p.Y };
this.AreaSeries.CategoryBinding = new GenericDataPointBinding<Point, double>() { ValueSelector = (p) => p.X };
this.AreaSeries.ValueBinding = new GenericDataPointBinding<Point, double>() { ValueSelector = (p) => p.Y };
...
var linePoints = CreateDataPoints();
LineSeries.ItemsSource = linePoints;
LineSeries.Stroke = new SolidColorBrush(StrokeColor);
var firstPoint = CreateDataPoints().Last();
var areaPoints = CreateAreaPoints(firstPoint);
AreaSeries.ItemsSource = areaPoints;
AreaSeries.Fill = new SolidColorBrush(StrokeColor);
Chart.Series.Add(this.LineSeries);
Chart.Series.Add(this.AreaSeries);
XAML:
<
telerik:RadCartesianChart
x:Name
=
"cartesianChart"
FontFamily
=
"{StaticResource MetroFontFamily}"
>
<
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:CategoricalAxis
FontFamily
=
"{StaticResource MetroFontFamily}"
FontSize
=
"10"
MajorStep
=
"10"
Title
=
"{Binding XTag}"
></
telerik:CategoricalAxis
>
</
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:RadCartesianChart.VerticalAxis
>
<
telerik:LinearAxis
Minimum
=
"{Binding Path=YMin}"
MajorStep
=
"10"
Maximum
=
"{Binding Path=YMax}"
FontFamily
=
"{StaticResource MetroFontFamily}"
FontSize
=
"10"
Title
=
"{Binding YTag}"
/>
</
telerik:RadCartesianChart.VerticalAxis
>
<
telerik:RadCartesianChart.Grid
>
<
telerik:CartesianChartGrid
MajorLinesVisibility
=
"Y"
MajorYLineDashArray
=
"3,4"
/>
</
telerik:RadCartesianChart.Grid
>
</
telerik:RadCartesianChart
>
Thank you in advance!!!