Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
150
Legend Position and Orientation
posted

Hi there, I couldn't find a way to position the legend away from the default right hand side location.

I would like to be able to set a location top,bottom, left , right of the chart ( with the legend items displayed in horizontal or vertical orientation).

Is this possible?

 

thanks.

Parents
  • 26458
    Verified Answer
    Offline posted

    You would have to modify the chart's template to get the legend in a different location. Here's an example of placing the legend on the left.

    <igChart:XamWebChart Name="chart">
      <igChart:XamWebChart.Template>
        <ControlTemplate TargetType="igChart:XamWebChart">
          <Grid x:Name="RootElement" Background="{TemplateBinding Background}">
            <Grid.ColumnDefinitions>
               <ColumnDefinition Width="Auto" MaxWidth="200"/>
               <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto"/>
              <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Grid x:Name="CaptionPanel" Grid.Row="0" Grid.ColumnSpan="2" Grid.Column="0"/>
            <Grid x:Name="ScenePanel" Grid.Column="1" Grid.Row="1"/>
            <Grid x:Name="LegendPanel" Grid.Column="0" Grid.Row="1" MaxWidth="200"/>
          </Grid>
        </ControlTemplate>
      </igChart:XamWebChart.Template>
     
    <igChart:XamWebChart.Series>
      <igChart:Series>
        <igChart:Series.DataPoints>
          <igChart:DataPoint Value="5"/>
        </igChart:Series.DataPoints>
      </igChart:Series>
     </igChart:XamWebChart.Series>
    </igChart:XamWebChart>

     

    Unfortunately, it's not possible to arrange the legend items horizontally at this time.

Reply Children