Hi,
I have a horizontal bar RadChart. I bind to one list of objects, so I have one series. I do not show a legend - basically I show text for the Name of the bound object at each data point, and the size of the bar is the Value. I have a third property which I would like to bind to the color of the bar. I haven't found how to do this in the documentation that I've found. Any ideas?
Here's the XAML:
In a perfect world, I would map (in the ItemMapping) some DataPointMember to the color of the bar, referencing the FieldName from my bound object, and a value converter to turn the property into a fill color.
Any help would be greatly appreciated.
-Dan Pingel
I have a horizontal bar RadChart. I bind to one list of objects, so I have one series. I do not show a legend - basically I show text for the Name of the bound object at each data point, and the size of the bar is the Value. I have a third property which I would like to bind to the color of the bar. I haven't found how to do this in the documentation that I've found. Any ideas?
Here's the XAML:
<telerikChart:RadChart VerticalAlignment="Top" UseDefaultLayout="False" MaxHeight="180" ItemsSource="{Binding CurrentShiftScrap, Converter={StaticResource emptyConverter}}"> <Grid> <telerikCharting:ChartArea x:Name="mainScrapArea" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" PaletteBrushesRepeat="False" EnableAnimations="False"> <telerikCharting:ChartArea.AxisX> <telerikCharting:AxisX MajorTicksVisibility="Collapsed" MinorTicksVisibility="Collapsed"> <telerikCharting:AxisX.AxisStyles> <telerikCharting:AxisStyles ItemLabelStyle="{StaticResource RightJustifyChartLabelStyle}"/> </telerikCharting:AxisX.AxisStyles> </telerikCharting:AxisX> </telerikCharting:ChartArea.AxisX> <telerikCharting:ChartArea.AxisY> <telerikCharting:AxisY StripLinesVisibility="Collapsed" MajorTicksVisibility="Collapsed" MinorTicksVisibility="Collapsed" AxisLabelsVisibility="Collapsed"/> </telerikCharting:ChartArea.AxisY> <telerikCharting:ChartArea.PaletteBrushes> <SolidColorBrush Color="#FF1199CC"/> </telerikCharting:ChartArea.PaletteBrushes> </telerikCharting:ChartArea> </Grid> <telerikChart:RadChart.SeriesMappings> <telerikCharting:SeriesMapping ChartAreaName="mainScrapArea"> <telerikCharting:SeriesMapping.SeriesDefinition> <telerikCharting:HorizontalBarSeriesDefinition ShowItemToolTips="True" ShowItemLabels="False" LegendDisplayMode="DataPointLabel" ItemToolTipFormat="#DATAITEM.Name: #DATAITEM.Value' Scrap"/> </telerikCharting:SeriesMapping.SeriesDefinition> <telerikCharting:SeriesMapping.ItemMappings> <telerikCharting:ItemMapping DataPointMember="XCategory" FieldName="Name"/> <telerikCharting:ItemMapping DataPointMember="YValue" FieldName="Value"/> </telerikCharting:SeriesMapping.ItemMappings> </telerikCharting:SeriesMapping> </telerikChart:RadChart.SeriesMappings></telerikChart:RadChart>In a perfect world, I would map (in the ItemMapping) some DataPointMember to the color of the bar, referencing the FieldName from my bound object, and a value converter to turn the property into a fill color.
Any help would be greatly appreciated.
-Dan Pingel