2013-04-30 43 views
1

chart如何更改WPF Toolkit中的图例名称

嗨!

这是WPF Toolkit折线图。

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

谢谢!

+3

你尝试_anything_? – 2013-04-30 14:24:25

+1

我试过谷歌,但没有找到任何东西。 – bbonch 2013-04-30 14:37:24

回答

4

供LineSeries标题= “按月数” 是负责显示图例文本

<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

该系列产品具有标题值

       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>