Hello,
I am using Telerik version 2012.1
What I am trying to do is to build a chart with a single source of data. But the source, the chart type, and the color should be able to be selected in drop down comboboxes. I am having trouble figuring out how to get the color set, don't know if it is because I have a generic chart in the XAML and am setting the series definition in an attached property, or if there is another reason. Below is a sample of my code, let me know if you need more. Thank you,
Eli
I am using Telerik version 2012.1
What I am trying to do is to build a chart with a single source of data. But the source, the chart type, and the color should be able to be selected in drop down comboboxes. I am having trouble figuring out how to get the color set, don't know if it is because I have a generic chart in the XAML and am setting the series definition in an attached property, or if there is another reason. Below is a sample of my code, let me know if you need more. Thank you,
Eli
<charting:RadChart Grid.Row="3"<br> PaletteBrushesUseSolidColors="True"<br> Name="lineChart"><br> <br> <attached:SeriesMapper.BindingInfo><br> <attached:SeriesBindingInfo DataTable="{Binding DataTable}"<br> EmissionsTemplate="{Binding Template}" /><br> </attached:SeriesMapper.BindingInfo><br><br> <charting:RadChart.DefaultView><br> <Charting:ChartDefaultView><br> <Charting:ChartDefaultView.ChartLegend><br> <Charting:ChartLegend Name="legend3" /><br> </Charting:ChartDefaultView.ChartLegend><br> <Charting:ChartDefaultView.ChartArea><br> <Charting:ChartArea LegendName="legend3"<br> Legend="{Binding Template.CurrentTemplate}"><br> <Charting:ChartArea.ZoomScrollSettingsX><br> <Charting:ZoomScrollSettings ScrollMode="ScrollAndZoom"<br> MinZoomRange=".005" /><br> </Charting:ChartArea.ZoomScrollSettingsX><br><br> <Charting:ChartArea.AxisX><br> <Charting:AxisX DefaultLabelFormat="{Binding AxisXLabelFormat}"<br> LabelStep="12"<br> Title="Date"<br> LayoutMode="Between" /><br> </Charting:ChartArea.AxisX><br> <Charting:ChartArea.AxisY><br> <Charting:AxisY AutoRange="True"<br> Title="{Binding Template.SelectedYColumn.Alias}"<br> ExtendDirection="None" /><br> </Charting:ChartArea.AxisY><br> </Charting:ChartArea><br> </Charting:ChartDefaultView.ChartArea><br> </Charting:ChartDefaultView><br> </charting:RadChart.DefaultView><br> </charting:RadChart><br> private static SeriesDefinition CreateSeriesDefinition(string seriesType)<br> {<br> SeriesDefinition series = null;<br><br> switch (seriesType)<br> {<br> case "Line":<br> series = CreateLineSeriesDefinition();<br> break;<br> case "Scatter":<br> series = CreateScatterSeriesDefinition();<br> break;<br> case "Spline":<br> series = CreateSplineSeriesDefinition();<br> break;<br> }<br><br> series.Appearance.Foreground = new SolidColorBrush(SystemColors.ControlDarkColor);<br> return series;<br> }