2013-12-17 3 views
0

WPFToolkit v 3.5.4를 사용하여 두 개의 라인 시리즈를 컬럼 시리즈에 오버레이하지만 라인 시리즈는 컬럼 시리즈의 왼쪽으로 '밀어 넣기'됩니다. 이미지의 상단 그래프에서 볼 수 있습니다. 모든 시리즈는 List <입니다. KeyValuePair < double, int >> 그리고 키/값 쌍을 확인하고 싶습니다.DataVisualization.Charting.Chart Columnseries의 라인리스를 오버레이 할 수 없습니다

두 번째 그래프는 다른 데이터를 사용하여 세 개의 LineSeries를 성공적으로 오버레이했지만보기에는 좋지 않습니다.

동일한 차트에 차트 시리즈 유형 (ColumnSeries, LineSeries)을 혼합하는 방법이 있습니까?

감사

다음은 XAML은 이미지의 두 그래프를위한이다 :

<chartingToolkit:Chart Name="lineChart1" Title="Series1" VerticalAlignment="Top" Margin="449,39,43,0" Height="262"> 

    <chartingToolkit:ColumnSeries DependentValuePath="Value" IndependentValuePath="Key" ItemsSource="{Binding [0]}" 
           IsSelectionEnabled="True" /> 
    <chartingToolkit:LineSeries DependentValuePath="Value" IndependentValuePath="Key" ItemsSource="{Binding [1]}" 
           IsSelectionEnabled="True" /> 
    <chartingToolkit:LineSeries DependentValuePath="Value" IndependentValuePath="Key" ItemsSource="{Binding [2]}" 
           IsSelectionEnabled="True" /> 
    <!-- Remove the legend --> 
    <chartingToolkit:Chart.LegendStyle> 
     <Style TargetType="Control"> 
      <Setter Property="Width" Value="0"/> 
      <Setter Property="Height" Value="0"/> 
     </Style> 
    </chartingToolkit:Chart.LegendStyle> 
</chartingToolkit:Chart> 

<chartingToolkit:Chart Name="lineChart2" Title="Series2" VerticalAlignment="Top" Margin="33,330,440,0" Height="262"> 
    <chartingToolkit:LineSeries DependentValuePath="Value" IndependentValuePath="Key" ItemsSource="{Binding [0]}" 
           IsSelectionEnabled="True" /> 
    <chartingToolkit:LineSeries DependentValuePath="Value" IndependentValuePath="Key" ItemsSource="{Binding [1]}" 
           IsSelectionEnabled="True" /> 
    <chartingToolkit:LineSeries DependentValuePath="Value" IndependentValuePath="Key" ItemsSource="{Binding [2]}" 
           IsSelectionEnabled="True" /> 
    <chartingToolkit:Chart.LegendStyle> 
     <Style TargetType="Control"> 
      <Setter Property="Width" Value="0"/> 
      <Setter Property="Height" Value="0"/> 
     </Style> 
    </chartingToolkit:Chart.LegendStyle> 
</chartingToolkit:Chart> 

Two Graphs

+0

감사합니다. Vorrtex! –

답변

0

당신이 ColumnSeries 먼저 넣고 그들이 사용하기 때문에 당신은 첫 번째 차트 LinearAxis을 설정해야 CategoryAxis 대신 올바른 번호를 사용하십시오. 여기

첫 번째 차트 코드입니다 :

<chartingToolkit:Chart Name="lineChart1" Title="Series1" VerticalAlignment="Top" Margin="449,39,43,0" Height="262"> 
    <chartingToolkit:Chart.Axes> 
     <chartingToolkit:LinearAxis Orientation="X" /> 
    </chartingToolkit:Chart.Axes> 
... 

두 번째 차트의 코드는 정확하지만 차트 당신 때문에 바인딩에 사용하는 데이터의 나쁜 보인다.

DataContext 속성을 설정하고 거기에 사용할 값을 게시하는 곳의 C# 코드를 게시하십시오.