Skip to main content

How to: Create a 2D Scatter Line Chart

The following example demonstrates how to create a Scatter Line chart. To do this, it is necessary to assign the ChartControl.Diagram property to XYDiagram2D, and then add a LineScatterSeries2D object with points to the diagram’s Diagram.Series collection.

View Example

<Window x:Class="ScatterLine2DChart.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts"
        Title="MainWindow" Height="400" Width="500" >
    <Grid>
        <dxc:ChartControl Name="chartControl1">
            <dxc:ChartControl.Diagram>
                <dxc:XYDiagram2D>
                    <dxc:XYDiagram2D.Series>
                        <dxc:LineScatterSeries2D ArgumentScaleType="Numerical" >
                            <dxc:LineScatterSeries2D.Points>
                                <dxc:SeriesPoint Argument="1" Value="1" />
                                <dxc:SeriesPoint Argument="3" Value="9" />
                                <dxc:SeriesPoint Argument="5" Value="1" />
                                <dxc:SeriesPoint Argument="0" Value="6" />
                                <dxc:SeriesPoint Argument="6" Value="6" />
                                <dxc:SeriesPoint Argument="1" Value="1" />
                            </dxc:LineScatterSeries2D.Points>
                                <dxc:LineScatterSeries2D.Label>
                                <dxc:SeriesLabel Visible="False" />
                            </dxc:LineScatterSeries2D.Label>
                        </dxc:LineScatterSeries2D>                                          
                    </dxc:XYDiagram2D.Series>
                </dxc:XYDiagram2D>
            </dxc:ChartControl.Diagram>
        </dxc:ChartControl>
    </Grid>
</Window>