如何在WPF Toolkit中更改图例名称

时间:2013-04-30 14:22:32

标签: c# wpf wpftoolkit

chart

嗨!

这是WPF工具包折线图。

有谁知道如何更改Series1文本programmaticaly?

谢谢!

2 个答案:

答案 0 :(得分:4)

LineSeries Title =“每月计数”负责显示图例文字

<wpft:Chart Canvas.Top="80" Canvas.Left="10" Name="mcChart"
       Width="400" Height="250"
       Background="LightSteelBlue">
    <wpft:Chart.Series>
     <wpft:LineSeries Title=" Monthly Count"
        IndependentValueBinding="{Binding Path=Key}"
        DependentValueBinding="{Binding Path=Value}">
</wpft:LineSeries>
</wpft:Chart.Series>           
</wpft:Chart>

答案 1 :(得分:1)

该系列具有标题值

                               Title="Deliveries by Hour"
                           Grid.Row="2"
                           Grid.Column="0"
                           Margin="10">
        <chartingToolkit:AreaSeries Title="Total added"
                                    DependentValuePath="Value"
                                    IndependentValuePath="Key"
                                    IsSelectionEnabled="True"
                                    ItemsSource="{Binding [0]}" />
        <chartingToolkit:AreaSeries Title="Sent"
                                    DependentValuePath="Value"
                                    IndependentValuePath="Key"
                                    IsSelectionEnabled="True"
                                    ItemsSource="{Binding [1]}" />
        <chartingToolkit:AreaSeries Title="3+ hours overdue"
                                    DependentValuePath="Value"
                                    IndependentValuePath="Key"
                                    IsSelectionEnabled="True"
                                    ItemsSource="{Binding [2]}" />
    </chartingToolkit:Chart>