This question is locked. New answers and comments are not allowed.
Hello,
I would like to thank you in advance for reading this!
Is there a way to bind the DataSeries data to a property when customizing a BarSeries/LineSeries style?
I know you can do this if the data is set at the ItemSource level, but what about the DataSeries level?
Ex:
Notice the line Stroke="{Binding DataItem.GradeColor}"
How would I bind this to a DataSeries set of information as opposed to the ItemSource set of information?
Thanks,
Matt
I would like to thank you in advance for reading this!
Is there a way to bind the DataSeries data to a property when customizing a BarSeries/LineSeries style?
I know you can do this if the data is set at the ItemSource level, but what about the DataSeries level?
Ex:
| <Style x:Key="BarSeriesStyle" TargetType="telerikCharting:Bar"> |
| <Setter Property="Template"> |
| <Setter.Value> |
| <ControlTemplate TargetType="telerikCharting:Bar"> |
| <Canvas> |
| <Rectangle x:Name="PART_DefiningGeometry" |
| Height="{TemplateBinding ItemActualHeight}" |
| Width="{TemplateBinding ItemActualWidth}" |
| RadiusX="2" |
| RadiusY="2" |
| Fill="Pink" |
| Stroke="{Binding DataItem.GradeColor}" |
| StrokeThickness="3" /> |
| </Canvas> |
| <ControlTemplate.Triggers> |
| <Trigger Property="IsMouseOver" Value="true"> |
| <Setter TargetName="PART_DefiningGeometry" Property="Fill" Value="{StaticResource LightBrush}"/> |
| <Setter TargetName="PART_DefiningGeometry" Property="Stroke" Value="{StaticResource LightBrush}"/> |
| <!--<Setter TargetName="Border" Property="SnapsToDevicePixels" Value="true"/>--> |
| </Trigger> |
| </ControlTemplate.Triggers> |
| </ControlTemplate> |
| </Setter.Value> |
| </Setter> |
| </Style> |
Notice the line Stroke="{Binding DataItem.GradeColor}"
How would I bind this to a DataSeries set of information as opposed to the ItemSource set of information?
Thanks,
Matt