MindFusion WinForms Programmer's Guide
Creating Scatter Charts

  1. Drag a new instance of the Line chart control and set its LineType property to Scatter.

C#  Copy Code

this.lineChart1.LineType = MindFusion.Charting.LineTypes.Scatter;

VB.NET  Copy Code

Me.LineChart1.LineType = MindFusion.Charting.LineTypes.Scatter

  1. Set the chart background with the BackgroundBrush property.
  2. Set the background of the plot area with PlotAreaBrush.
  3. Use AxisPen to specify the pen for the axes - in this sample it is a grey one, width 2.
  4. Create a grid: set the GridType to HorScale, and then choose a GridBrush and AltGridBrush. Set the GridPen to a dashed one.

C#  Copy Code

this.lineChart1.GridType = MindFusion.Charting.GridType.HorScale;

VB.NET  Copy Code

Me.LineChart1.GridType = MindFusion.Charting.GridType.HorScale

  1. Set the title label - enter 'Scatter Chart' in the TitleText property field. Use TitleFont and TitleBrush to set the font and color of the title.

C#  Copy Code

this.lineChart1.TitleText = "Scatter Chart";

VB.NET  Copy Code

Me.LineChart1.TitleText = "Scatter chart"

  1. Specify Verdana, 10 pt. font for the labels with LabelFont.
  2. Specify the data for the chart - enter 1,3,5,7,9 in the XData property using the SeriesCollection editor.

C#  Copy Code

this.lineChart1.XData = new MindFusion.Charting.SeriesCollection("1,3,5,7,9");

VB.NET  Copy Code

Me.LineChart1.XData = New MindFusion.Charting.SeriesCollection("1,3,5,7,9")

  1. Enter two series of data in the YData property: Serie0: 30,44,18,33 and Serie1: 10,20,35,22 by using the SeriesCollection Editor.

C#  Copy Code

this.lineChart1.YData = new MindFusion.Charting.SeriesCollection("30,44,18,33;10,20,35,22");

VB.NET  Copy Code

Me.LineChart1.YData = New MindFusion.Charting.SeriesCollection("30,44,18,33;10,20,35,22")

  1. Set the following properties of the X-axis with the XAxisSettings object:

  1. Set the appearance options for the Y-axis with the YAxisSettings property:

  1. Set the YAxisSettings.DrawZero property to true to show the zero label at the Y-axis.
  2. Specify the type of Shape-s that you want for the scatter chart. Add the chosen values to the Shapes property, clear any already added Shape objects beforehand. Update the chart with the newly set options. Write the following lines of code in the constructor of the Form, which contains the chart control, after InitializeComponent:

C#  Copy Code

 this.lineChart1.Shapes.Clear();
 this.lineChart1.Shapes.Add(MindFusion.Charting.Shape.Rhombus);
 this.lineChart1.Shapes.Add(MindFusion.Charting.Shape.Circle);
 this.lineChart1.UpdateChart();

VB.NET  Copy Code

 Me.LineChart1.Shapes.Clear()
 Me.LineChart1.Shapes.Add(MindFusion.Charting.Shape.Rhombus)
 Me.LineChart1.Shapes.Add(MindFusion.Charting.Shape.Circle)
 Me.LineChart1.UpdateChart()

  1. Use the ShapePens property to specify the pens that draw the outlining of the scatter Shapes. Add and edit the pens with the PenCollection Editor.
  2. Set the size of the scatter shapes using ShapeSizes. Enter the desired values, for example 20 and 30, separated by commas in the Property Designer of Visual Studio, for example write "20,30".
  3. The Scatter chart will be updated with the described settings: