Just realized the code couldn't be attached, here it is.
public
FilesChart()
{
InitializeComponent();
var db =
new
Context();
var result = db.FILESPROCESSEDs.Select(m => m.TYPE).Distinct();
List<String> listResult = result.ToList();
foreach
(
string
type
in
listResult)
{
var source = db.FILESPROCESSEDs.Where(m => m.TYPE == type);
BarSeries test =
new
BarSeries
{
DataSource = source.ToList(),
ValueMember =
"AMOUNT"
,
CategoryMember =
"DATETIME"
,
IsVisibleInLegend =
true
,
LegendTitle = type,
CombineMode = Telerik.Charting.ChartSeriesCombineMode.Stack
};
/*DateTimeCategoricalAxis categoricalAxis = new DateTimeCategoricalAxis();
categoricalAxis.DateTimeComponent = Telerik.Charting.DateTimeComponent.Hour;
categoricalAxis.PlotMode = Telerik.Charting.AxisPlotMode.BetweenTicks;
categoricalAxis.LabelFormat = "{0:HH:mm}";
test.HorizontalAxis = categoricalAxis;*/
radChartView1.Series.Add(test);
}
radChartView1.ShowLegend =
true
;
}