I have a User Control with this RadChart defined in xaml:
<
telerik:RadChart
Grid.Row
=
"1"
HorizontalAlignment
=
"Center"
Margin
=
"0,0,0,0"
VerticalAlignment
=
"Center"
Name
=
"radChart"
>
<
telerik:RadChart.SeriesMappings
>
<
telerik:SeriesMapping
LegendLabel
=
"Fin"
>
<
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:SplineSeriesDefinition
ShowItemToolTips
=
"True"
ShowItemLabels
=
"False"
ShowPointMarks
=
"False"
></
telerik:SplineSeriesDefinition
>
</
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:SeriesMapping.ItemMappings
>
<
telerik:ItemMapping
DataPointMember
=
"XValue"
FieldName
=
"XValue"
/>
<
telerik:ItemMapping
DataPointMember
=
"YValue"
FieldName
=
"YValue1"
/>
</
telerik:SeriesMapping.ItemMappings
>
</
telerik:SeriesMapping
>
<
telerik:SeriesMapping
LegendLabel
=
"Avv"
>
<
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:SplineSeriesDefinition
ShowItemToolTips
=
"True"
ShowItemLabels
=
"False"
ShowPointMarks
=
"False"
></
telerik:SplineSeriesDefinition
>
</
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:SeriesMapping.ItemMappings
>
<
telerik:ItemMapping
DataPointMember
=
"XValue"
FieldName
=
"XValue"
/>
<
telerik:ItemMapping
DataPointMember
=
"YValue"
FieldName
=
"YValue2"
/>
</
telerik:SeriesMapping.ItemMappings
>
</
telerik:SeriesMapping
>
<
telerik:SeriesMapping
LegendLabel
=
"Avv"
>
<
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:SplineSeriesDefinition
ShowItemToolTips
=
"True"
ShowItemLabels
=
"False"
ShowPointMarks
=
"False"
></
telerik:SplineSeriesDefinition
>
</
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:SeriesMapping.ItemMappings
>
<
telerik:ItemMapping
DataPointMember
=
"XValue"
FieldName
=
"XValue"
/>
<
telerik:ItemMapping
DataPointMember
=
"YValue"
FieldName
=
"YValue3"
/>
</
telerik:SeriesMapping.ItemMappings
>
</
telerik:SeriesMapping
>
</
telerik:RadChart.SeriesMappings
>
<
telerik:RadChart.DefaultView
>
<
telerik:ChartDefaultView
>
<
telerik:ChartDefaultView.ChartArea
>
<
telerik:ChartArea
PaletteBrushesRepeat
=
"False"
x:Name
=
"chartArea"
>
<
telerik:ChartArea.PaletteBrushes
>
<
SolidColorBrush
Color
=
"Red"
/>
<
SolidColorBrush
Color
=
"Blue"
/>
<
SolidColorBrush
Color
=
"Green"
/>
</
telerik:ChartArea.PaletteBrushes
>
</
telerik:ChartArea
>
</
telerik:ChartDefaultView.ChartArea
>
<
telerik:ChartDefaultView.ChartLegend
>
<
telerik:ChartLegend
Visibility
=
"Hidden"
Width
=
"0"
/>
</
telerik:ChartDefaultView.ChartLegend
>
</
telerik:ChartDefaultView
>
</
telerik:RadChart.DefaultView
>
</
telerik:RadChart
>
In code behind of this User Control I have this property:
public
object
SignalsItemsSource
{
get
{
return
radChart.ItemsSource; }
set
{ radChart.ItemsSource = value; }
}
I set this property with 700 points that start on x from 0:
Dictionary<
int
,
double
> _dicY1 =
new
Dictionary<
int
,
double
>();
Dictionary<
int
,
double
> _dicY2 =
new
Dictionary<
int
,
double
>();
Dictionary<
int
,
double
> _dicY3 =
new
Dictionary<
int
,
double
>();
for
(
int
_ii = 0; _ii < 700; _ii++)
{
Random _random =
new
Random(DateTime.Now.Millisecond);
_dicY1[_ii] = _random.NextDouble();
_dicY2[_ii] = _random.NextDouble();
_dicY3[_ii] = _random.NextDouble();
}
_itemSource = _dicY1.Keys.Select(_k =>
new
{ XValue = _k, YValue1 = _dicY1[_k], YValue2 = _dicY2[_k], YValue3 = _dicY3[_k] }).OrderBy(_v => _v.XValue);
_userControl.SignalsItemsSource = _itemSource;
I have the X-Axis start from negative value, it is possibile configure RadChart to start from 0 or min value of X-Axis?
Greetings,
Paolo