I’m using the YAxes property of the chart to data bind to a collection of NumericAxisViewModels. Is there a way to rotate the tick labels in this scenario. I can’t define a style in XAML and then assign it to the Axis because the axis is created in scichart somewhere. All I have is the axis view model. I have a LabelProvider but it doesn’t seem to support rotation unless I access the ParentAxis. Ultimately I would like to rotate some vertical axis and not other but I might be able to live with rotating all of them.
I have tried defining a style in xaml that applies to all numeric axis but it didn’t work:
<Style TargetType="{x:Type s:DefaultTickLabel}">
<Setter Property="LayoutTransform">
<Setter.Value>
<RotateTransform Angle="-90"/>
</Setter.Value>
</Setter>
</Style>
Adding a LabelProvider sort of works but seems a little hacky and doesn’t set the scale appropriately ( I have to zoom to extends to see the labels). Is this the way I am supposed to do it?
public override string FormatLabel(IComparable dataValue) {
var style = new Style(typeof(DefaultTickLabel));
style.Setters.Add(new Setter(DefaultTickLabel.LayoutTransformProperty, new RotateTransform(-90.0)));
ParentAxis.TickLabelStyle = style;
- patrick milinazzo asked 6 years ago
- last edited 6 years ago
- You must login to post comments
Please login first to submit.