I have a RadChart configured to display total sales in dollars by year. The issue is the first two years' data overlap in the display causing the following years to be displayed in the wrong areas. I can only imagine this is something simple that I am overlooking.
Here is a screen shot: http://img12.imageshack.us/img12/3365/linecharproblem.png
Here is my code:
Here is a screen shot: http://img12.imageshack.us/img12/3365/linecharproblem.png
Here is my code:
//Line chart
radChart1.DefaultView.ChartLegend.UseAutoGeneratedItems =
true
;
DataSeries seriesSet =
new
DataSeries();
seriesSet.Definition =
new
LineSeriesDefinition();
SolidColorBrush lineChartColor = GetColorFromHexa(
"#ff000066"
);
seriesSet.Definition.Appearance.Fill = lineChartColor;
//Axis X
radChart1.DefaultView.ChartArea.AxisX.AutoRange =
true
;
radChart1.DefaultView.ChartArea.AxisX.Step = 1;
radChart1.DefaultView.ChartArea.AxisX.DefaultLabelFormat =
"0"
;
radChart1.DefaultView.ChartArea.AxisX.LayoutMode = AxisLayoutMode.Between;
//Axis Y
radChart1.DefaultView.ChartArea.AxisY.Title =
"Dollars"
;
radChart1.DefaultView.ChartArea.AxisY.DefaultLabelFormat =
"0"
;
foreach
(var item
in
_vm.workingPart.PartsSold)
{
seriesSet.Add(
new
DataPoint(
(
double
)item.Item1, //Year
(
double
)item.Item4 //Amount of sales
));
}
foreach
(var item
in
seriesSet)
{
item.LabelFormat =
"#Y{C}"
;
}
radChart1.DefaultView.ChartLegend.Visibility = Visibility.Collapsed;
radChart1.DefaultView.ChartArea.DataSeries.Add(seriesSet);