2015-12-15 50 views
0

我正在使用WPF中的infragistics XamDataChart。 我想並行創建2個傳說。我能夠這樣做,但這兩個傳說之間有很多空間。我希望他們彼此相鄰,以便兩者之間沒有空間。所以在視覺上它看起來像2列傳說。WPF中的空間圖例xamchart

代碼很簡單

 <ScrollViewer VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,-44,140,0" VerticalScrollBarVisibility="Hidden"> 
     <StackPanel Orientation="Horizontal"> 
     <ig:Legend x:Name="xamLegend1" Orientation="Vertical" FontFamily="Calibri" FontSize="12" Foreground="#FFFFFF" Background="#34678F" ></ig:Legend> 
     <ig:Legend x:Name="xamLegend2" Orientation="Vertical" FontFamily="Calibri" FontSize="12" Foreground="#FFFFFF" Background="#34678F" ></ig:Legend> 
     </StackPanel> 

回答

0

使用下面的示例,以幫助額外的空間

<igCA:XamChart View3D="False" x:Name="chart" MinHeight="210" MinWidth="210" Margin="8,8,8,8"> 
      <igCA:XamChart.Series> 
       <igCA:Series ChartType="Column"> 
       <igCA:Series.DataPoints> 
        <igCA:DataPoint Value="3" Fill="#FFD70005" Label="Italy"/> 
        <igCA:DataPoint Value="5" Fill="#FF6CA224" Label="Spain"/> 
        <igCA:DataPoint Value="4" Fill="#FF076CB0" Label="France"/> 
        <igCA:DataPoint Value="7" Fill="#FFE6BE02" Label="China"/> 
        <igCA:DataPoint Value="5" Fill="#FF543792" Label="Portugal"> 
        </igCA:DataPoint> 
       </igCA:Series.DataPoints> 
        </igCA:Series>    
      </igCA:XamChart.Series> 
    <igCA:XamChart.Legend> 
    <igCA:Legend Visible="False"/> 
    </igCA:XamChart.Legend> 
    <igCA:XamChart.Scene> 
    <igCA:Scene Margin="0,0,0,0" MarginType="Percent"> 
    <igCA:Scene.GridArea> 
     <igCA:GridArea Margin="5,2,0,5" MarginType="Percent"/> 
    </igCA:Scene.GridArea> 
    </igCA:Scene> 
    </igCA:XamChart.Scene> 
    </igCA:XamChart> 
+0

這不是解決我的問題。 – meriaz