用于xamchart的WPF图例中的空格

时间:2015-12-15 06:07:43

标签: wpf legend infragistics xamdatachart

我正在研究WPF中的infragistics XamDataChart。 我想并行创建2个图例。我能够这样做,但这两个传说之间有很多空间。我希望它们彼此相邻,以便它们之间没有空间。所以在视觉上它看起来像一个2列的传奇。

代码很简单

        <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>

1 个答案:

答案 0 :(得分: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>