This question is locked. New answers and comments are not allowed.
Part of my c# source : (EnGe and EnEf are arrays of double's)
public class ChartDataClass
{
public double XValue { get; set; }
public double YValue { get; set; }
}
private void avoiddispatcher()
{
var chartDatas = new List<ChartDataClass>();
var chartDatas2 = new List<ChartDataClass>();
for (int i = 0; i < count; i++)
{
var cdc = new ChartDataClass();
cdc.XValue = i;
cdc.YValue = EnGe[i];
chartDatas.Add(cdc);
var cdc2 = new ChartDataClass();
cdc2.XValue = i;
cdc2.YValue = EnEf[i];
chartDatas2.Add(cdc2);
}
chart1.Series[0].ItemsSource = chartDatas;
chart1.Series[1].ItemsSource = chartDatas2;
}
XAML :
<chart:RadCartesianChart x:Name="chart1">
<chart:RadCartesianChart.HorizontalAxis>
<chart:CategoricalAxis/>
</chart:RadCartesianChart.HorizontalAxis>
<chart:RadCartesianChart.VerticalAxis>
<chart:LinearAxis Title="watt hours"/>
</chart:RadCartesianChart.VerticalAxis>
<chart:RadCartesianChart.Series>
<chart:LineSeries Stroke="Orange" StrokeThickness="1" CategoryBinding="XValue" ValueBinding="YValue"/>
<chart:AreaSeries Stroke="Blue" StrokeThickness="1" CategoryBinding="XValue" ValueBinding="YValue" />
</chart:RadCartesianChart.Series>
</chart:RadCartesianChart>
When executing I get only ONE line in the chart, instead of two .....
(Using the trial-version)
How can I solve this ?
Thanks in advance !
Marco
public class ChartDataClass
{
public double XValue { get; set; }
public double YValue { get; set; }
}
private void avoiddispatcher()
{
var chartDatas = new List<ChartDataClass>();
var chartDatas2 = new List<ChartDataClass>();
for (int i = 0; i < count; i++)
{
var cdc = new ChartDataClass();
cdc.XValue = i;
cdc.YValue = EnGe[i];
chartDatas.Add(cdc);
var cdc2 = new ChartDataClass();
cdc2.XValue = i;
cdc2.YValue = EnEf[i];
chartDatas2.Add(cdc2);
}
chart1.Series[0].ItemsSource = chartDatas;
chart1.Series[1].ItemsSource = chartDatas2;
}
XAML :
<chart:RadCartesianChart x:Name="chart1">
<chart:RadCartesianChart.HorizontalAxis>
<chart:CategoricalAxis/>
</chart:RadCartesianChart.HorizontalAxis>
<chart:RadCartesianChart.VerticalAxis>
<chart:LinearAxis Title="watt hours"/>
</chart:RadCartesianChart.VerticalAxis>
<chart:RadCartesianChart.Series>
<chart:LineSeries Stroke="Orange" StrokeThickness="1" CategoryBinding="XValue" ValueBinding="YValue"/>
<chart:AreaSeries Stroke="Blue" StrokeThickness="1" CategoryBinding="XValue" ValueBinding="YValue" />
</chart:RadCartesianChart.Series>
</chart:RadCartesianChart>
When executing I get only ONE line in the chart, instead of two .....
(Using the trial-version)
How can I solve this ?
Thanks in advance !
Marco