在Visiblox图表中包裹图例

时间:2011-07-22 21:33:14

标签: c# visiblox

当我在Visiblox图表中明确设置图例的宽度时,我发现图例项目文本被切断而不是换行。例如,

<Style x:Key="LegendStyle" TargetType="{x:Type charts:Legend}">
    <Setter Property="Width" Value="200" />
</Style>

<charts:Chart Name="chart" LegendStyle="{StaticResource LegendStyle}" />

我知道我可以使用Chart控件的LegendTemplate属性为Legend类提供ControlTemplate。但是,我不确定如何修改它以在子LegendItem控件中生成文本换行。我也不确定如何修改用于绘制LegendItem控件以生成文本换行的模板。有没有办法做到这一点?

1 个答案:

答案 0 :(得分:2)

提供LegendItemTemplate或LegendItemStyle可能更容易。这些是系列类型的依赖项属性。您可以在“样式和模板”部分的documentation中获取更多信息。