Chart3D for WPF and Silverlight | ComponentOne
Chart3D for WPF and Silverlight Overview / Using Chart3D for WPF and Silverlight / Adding a Chart Legend
In This Topic
    Adding a Chart Legend
    In This Topic

    Chart3D for WPF and Silverlight allows you to show a legend for contour or zone charts.The legend element displays information about each data series of the chart. The chart legend displays the mapping between the physical colors and the data series. It is controlled by the Legend property of C1Chart3D.

    To add a legend for the chart, follow these steps:

    1. Add a C1Chart3D control to the window.
    2. Set the ChartType to SurfaceZone or SurfaceZoneContour. The XAML will look similar to the following:
    XAML
    Copy Code
    <c1chart3d:C1Chart3D Height="150" HorizontalAlignment="Left" Margin="137,77,0,0" Name="c1Chart3D1" VerticalAlignment="Top" Width="200" ChartType="SurfaceZone">
               <c1chart3d:GridDataSeries ZDataString="1 1 1,2 2 2,3 3 3" /> </c1chart3d:C1Chart3D>
    
    1. Set the Legend property to C1Chart3DLegend. Now the XAML will look like this:
    XAML
    Copy Code
    <c1chart3d:C1Chart3D Height="150" HorizontalAlignment="Left" Margin="178,85,0,0" Name="c1Chart3D1" VerticalAlignment="Top" Width="200" ChartType="SurfaceZone">
                <c1chart3d:C1Chart3D.Legend>
                    <c1chart3d:C1Chart3DLegend />
                </c1chart3d:C1Chart3D.Legend>
                <c1chart3d:GridDataSeries ZDataString="1 1 1,2 2 2,3 3 3" />
    </c1chart3d:C1Chart3D>
    

    Your chart will look similar to the following:

    Note that a legend is visible for contour or zone charts only.

     

    See Also