Hello,
I have a xamchart. ChartType=Pie. The Legend textblocks are editable. First question is, how can I disable the legend textblocks? Second, When the text is long for the legend, the size of the text and the circle are getting smaller. How can I fix the size of the text and the circle?
What do you mean by the legend textblocks being editable? What do you mean by disabling them? Hiding the legend? Or something else? Could you clarify?
Thanks,
-Graham
In my pie chart the texts on the legend are editable. In the Future Browser you can see this situation easily.
xamChart->Chart Types Gallery->Light 3D-> You can change "Belarus", "Greece" ....
I do not want them editable.
The legend text is by default not editable, but I'm guessing you've applied the styles/templates from the sample that you referenced:
<DataTemplate DataType="{x:Type igCA:LegendItemTemplate}"> <Grid Background="{x:Null}" Margin="0,0,0,0" Width="Auto" Height="Auto"> <Viewbox HorizontalAlignment="Left" MaxHeight="20" VerticalAlignment="Stretch" Stretch="Uniform"> <StackPanel Orientation="Horizontal" Width="Auto" Height="Auto"> <Grid Width="Auto"> <Ellipse Fill="{Binding Path=Fill}" Width="11" Height="11" StrokeThickness="1" /> </Grid> <TextBox Text="{Binding Path=Text}" VerticalAlignment="Bottom" HorizontalAlignment="Left" Background="{x:Null}" BorderBrush="{x:Null}" Margin="3,0,0,0" BorderThickness="0,0,0,0"/> </StackPanel> </Viewbox> </Grid> </DataTemplate>
Which uses a Textbox to display the legend item content. You should be able to shift this to be a TextBlock instead and the text will stop being editable. Or, if you still want to be able to select the legend item text you could just set IsReadOnly to true on the TextBox in the data template above.
I put IsReadoly Property to that style, works great. Thank you very much.