The Markers on my pie chart wrap after a few characters. I can reduce the wrapping by reducing the marker font size, but is there a way to "turn off" the wrapping?
John Myczek
That works for the Markers, but since it affects all TextBlocks, it messes up the Caption and Legend. I submitted a feature request for this. In the meantime, I'll keep playing with the styles and see if I can find one that works for all the TextBlocks.
Thanks for your help and I look forward to future releases of xamChart (hopefully with my feature request included )
John
Hi John,
You can access the TextBlock properties by creating a style and applying it to all TextBlocks in the XamChart scope. The following snippet works for setting the text to Bold. Unfortunately, the other properties do not work as expected.
<igCA:XamChart.Resources> <Style x:Key="{x:Type TextBlock}" TargetType="{x:Type TextBlock}"> <Setter Property="FontWeight" Value="Bold"/> <Setter Property="TextWrapping" Value="NoWrap"/> <Setter Property="TextAlignment" Value="Left"/> </Style></igCA:XamChart.Resources>
Setting alignment or wrapping for the TextBlock in a style do not affect those properties in the xamChart. TextWrapping and TextAlignment are ignored. XamChart overrides certain TextBlock properties when it is arranging the control. In order to have more control how the Marker is arranged and rendered in the chart, we will need to have more functionality exposed to developers. Until then, you can try modifying the layout by manipulating certain properties. The following appears to work with your sample project. Nore, it affects all TextBlocks in the xamChart.
<igCA:XamChart.Resources> <Style x:Key="{x:Type TextBlock}" TargetType="{x:Type TextBlock}"> <Setter Property="MinWidth" Value="50"/> <Setter Property="Margin" Value="-10,5,0,0"/> </Style></igCA:XamChart.Resources>
Please request the Marker layout functionality feature at our feature request webpage:http://devcenter.infragistics.com/Protected/RequestFeature.aspx
Thank you,
Yes, I have tried changing the text style and I can reduce the wrapping by decreasing the font size, but not eliminate it completely. I have attached a sample project that demonstrates the wrapping. I append an "MB" to the marker and the "B" wraps. You could also see the wrapping by increasing the values of the data points (15000 instead of 150).
I Snooped the control and saw that the markers are rendered as TextBlock. If I manually increase the Width of the TextBlock and set the TextAlignment to "Left", I can eliminate the wrapping. However, the Marker does not expose these properties.
Thanks,
The Marker class does not have a TextWrapping property. There may be a way to customize the text wrapping through a style or by creating a custom template. Before we go down that route, have you tried any of the Marker properties to modify the text style, font, or size? Send me a snippet of your XAML or code so I might reproduce the problem and see what other solution I could offer.
Thanks