Hello,
Assumed we have a chart with NumericXAxis nd NumericYAxis. Let's say the Y value changes between 0 and 100.
Is there any possibility to replace standard YAxis labels with literal aliases such as "Top" by 90, "Standard" by 40 and "Poor" by 25?
Thank you.
Bonitz.
Hello Bonitz,
Thank you for your post. I am sorry for the late replay. I have created a small sample for you, named StylingYAxis. In the sample I use a converter to change the value displayed on the Y axis. Then bind the converter to the TextBlock, that shows the values. Please refer to the attached sample application and feel free to let me know if you have any further questions on the matter.
Hello Gergana,
thank you.
Hello bonitz,
Thank you for the feedback. Please do not hesitate to le t me know if you have any further questions on the matter.
thank you for reply. The solution works wery nice.
Is it possible to set the value converter to axis Label in code behind if i add axes dynamically?
Regards
Bonitz
Here is a workaround.
1. Define new axis style.
<Style x:Key="AxisStyle" TargetType="ig:Axis"> <Setter Property="Label"> <Setter.Value> <DataTemplate> <TextBlock Text="{Binding Item, Converter={StaticResource AxisConverter}}"/> </DataTemplate> </Setter.Value> </Setter> </Style>
2. Set axis style in code behind.
RegardsBonitz
Thank you for the feedback. I am glad that you have found a solution to your issue. Please do not hesitate to contact us if you have any questions.