I have a problem working with a LineSeries in a RadCartesianChart: my binding series has 10 values, but the chart only shows 1 of them.
What could be the problem in my code?
XAML:
Data Class:
Creating the data and loading it to the chart:
What could be the problem in my code?
XAML:
<
telerik:RadCartesianChart
x:Name
=
"chPrueba"
HorizontalAlignment
=
"Left"
Margin
=
"10,10,0,0"
VerticalAlignment
=
"Top"
Width
=
"972"
Height
=
"477"
>
<
telerik:RadCartesianChart.Grid
>
<
telerik:CartesianChartGrid
MajorLinesVisibility
=
"XY"
StripLinesVisibility
=
"Y"
MajorXLineDashArray
=
"10, 5"
MajorXLinesRenderMode
=
"All"
>
<
telerik:CartesianChartGrid.YStripeBrushes
>
<
SolidColorBrush
Color
=
"#FFDFDFDF"
Opacity
=
"0.3"
/>
<
SolidColorBrush
Color
=
"Transparent"
/>
</
telerik:CartesianChartGrid.YStripeBrushes
>
</
telerik:CartesianChartGrid
>
</
telerik:RadCartesianChart.Grid
>
<
telerik:RadCartesianChart.VerticalAxis
>
<
telerik:LinearAxis
Minimum
=
"0"
Maximum
=
"100"
/>
</
telerik:RadCartesianChart.VerticalAxis
>
<
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:CategoricalAxis
LabelOffset
=
"0"
LastLabelVisibility
=
"Visible"
LineThickness
=
"1"
MajorTickOffset
=
"0"
MajorTickInterval
=
"1"
PlotMode
=
"BetweenTicks"
TickThickness
=
"1"
ZIndex
=
"0"
LabelFitMode
=
"Rotate"
/>
</
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:LineSeries
x:Name
=
"chLineSeries"
CategoryBinding
=
"fecha"
ValueBinding
=
"valor"
AllowSelect
=
"True"
Stroke
=
"#FF0DAE0D"
/>
<
telerik:RadCartesianChart.Behaviors
>
<
telerik:ChartTrackBallBehavior
ShowIntersectionPoints
=
"True"
/>
</
telerik:RadCartesianChart.Behaviors
>
</
telerik:RadCartesianChart
>
Data Class:
public
class
vAbortos
{
public
Double valor {
get
;
set
; }
public
String fecha {
get
;
set
;}
public
vAbortos()
{
}
}
Creating the data and loading it to the chart:
public
void
WindowLoaded()
{
List<vAbortos> valores =
new
List<vAbortos> { };
Random rnd =
new
Random();
DateTime fc =
new
DateTime(2013, 12, 1);
for
(
int
i = 0; i <= 9; i++)
{
vAbortos ab =
new
vAbortos();
ab.fecha = fc.AddDays(1).ToShortDateString();
fc.AddDays(1);
ab.valor = rnd.NextDouble() * 10;
valores.Add(ab);
}
this
.chPrueba.Series[0].ItemsSource = valores;
(chPrueba.VerticalAxis
as
LinearAxis).Minimum = 0;
(chPrueba.VerticalAxis
as
LinearAxis).Maximum = 15;
}