Spaces in WPF Legend for xamchart

276 Views Asked by At

I am working on infragistics XamDataChart in WPF. I want to create 2 legends in parallel. I am able to do so, but there is lots of space coming between these 2 legends. i want them to be adjacent to each other such that there is no space between. So visually it look like a 2 column legend.

Code is very simple

        <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

There are 1 best solutions below

1
On

Use the following example to help with the additional spaces

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