Does anyone have an example of a MarkerStyle to change the orientation of text in a label? For example, make the labels in a column chart go vertical so they don't overlap each other. I assume it can be done with a styel and a transform, but don't wanna do the work if someone else already has...
Thanks,Keith
whoops ... you need to set the Marker Type to "Custom."
<igChart:Marker Type="Custom">
Thanks David, but I'm still having problems with your example. I understand it will only work for the first point. But, I expect from your template to see the text "Point A" at a 45 degree angle along with the marker circle and 1. All I see is the marker circle and 1. No "Point A". If I do Format = " ", then I can get the 1 to go away, but I don't see the "Point A". See Chart.jpg below.
If I could get the "Point A" to show up, I'd have a workaround by setting it on every DataPoint like you mention, but I can't get that to show up using your example above. Again, I'm on 9.1 still, so, if it's just an upgrade to 9.2 thing to make this work, that's fine. Once I get time, I can do that.
dmTech04 said:But your above example just renders a default marker with the value 1 for the first data point.
unfortunately i had to use the DataPoint marker, not the Series marker, due to the inability to bind to the properties of the DataPoint from the template. if you follow my code example, you would have to add a marker to each DataPoint.
dmTech04 said:Mine above works, but isn't what I want. It puts the text oriented, but then the label still shows up.
you can avoid this by setting the Marker Format to " ".
dmTech04 said:Ideally I could bind to the DataPoint from the Marker Template.
this is not currently possible, but you can submit a feature request here: http://devcenter.infragistics.com/protected/requestfeature.aspx
Thanks David, I can't get this example to work using 9.1 charts. I can set it for the whole series using:
<Style x:Key="stylemarker" TargetType="igChart:MarkerPointTemplate"><Setter Property="Template"><Setter.Value><ControlTemplate TargetType="igChart:MarkerPointTemplate"><TextBlock Text="Point A"><TextBlock.RenderTransform><RotateTransform Angle="-90" CenterX="0.5" CenterY="0.5" /></TextBlock.RenderTransform></TextBlock></ControlTemplate></Setter.Value></Setter></Style>
<igChart:Series.Marker><igChart:Marker Type="Custom" MarkerSize="2" Style="{StaticResource stylemarker}" /></igChart:Series.Marker>
But your above example just renders a default marker with the value 1 for the first data point. Should it work on 9.1?
Mine above works, but isn't what I want. It puts the text oriented, but then the label still shows up. Ideally I could bind to the DataPoint from the Marker Template. Is that possible (in 9.1 or 9.2), or is it in the plans? Even better would be a Angle option on the marker just like on the Axes.
the text part of the marker can't actually be rotated because it is not part of the Marker template which can be overridden like in this code:
<igChart:XamWebChart> <igChart:XamWebChart.Series> <igChart:Series> <igChart:Series.DataPoints> <igChart:DataPoint Value="1" Label="Point A"> <igChart:DataPoint.Marker> <igChart:Marker> <igChart:Marker.Style> <Style TargetType="igChart:MarkerPointTemplate"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="igChart:MarkerPointTemplate"> <TextBlock Text="Point A"> <TextBlock.RenderTransform> <RotateTransform Angle="45" /> </TextBlock.RenderTransform> </TextBlock> </ControlTemplate> </Setter.Value> </Setter> </Style> </igChart:Marker.Style> </igChart:Marker> </igChart:DataPoint.Marker> </igChart:DataPoint> <igChart:DataPoint Value="2" Label="Point B" /> <igChart:DataPoint Value="3" Label="Point C" /> <igChart:DataPoint Value="4" Label="Point D" /> </igChart:Series.DataPoints>
</igChart:Series> </igChart:XamWebChart.Series> </igChart:XamWebChart>
you can use the above technique to display angled datapoint markers, however you would need to set the style for each one; as you can see, the marker's text has to be specified explicitly in the template.