Hi,
I want to draw a line chart with data from my database.
I already did make a barchart this way, so I just used that code to create the linechart.
Now my problem is showing datetime on the x-axis.
This worked just fine with the barchart, but with the linechart the dates aren't shown!
SeriesMapping
smLine = new SeriesMapping();
smLine.ItemMappings.Add(
new ItemMapping("Percentage", DataPointMember.YValue));
smLine.ItemMappings.Add(
new ItemMapping("Time", DataPointMember.XValue));
LineChart.SeriesMappings.Add(smLine);
LineChart.DefaultSeriesDefinition =
new LineSeriesDefinition()
{
ShowItemLabels =
true,
ShowItemToolTips =
true,
};
LineChart.ItemsSource = e.Result;
XAxis:
LineChart.DefaultView.ChartArea.AxisX.Title =
"OEE & Losses";
LineChart.DefaultView.ChartArea.AxisX.LabelRotationAngle = 45;
LineChart.DefaultView.ChartArea.AxisX.DefaultLabelFormat =
"HH:mm";
LineChart.DefaultView.ChartArea.AxisX.LayoutMode =
AxisLayoutMode.Inside;