ScatterChart

ScatterChart ( appearanceConst ;​ doShiftIntervals )

Argument Type Range Default Note
appearanceConst int 0..127 default
doShiftIntervals int 0..1 off
Description

The ScatterChart() function serves to draw one-dimensional scatter charts.

SCATTER_CHART_01
1

OpenDrawing(250;​150)

2

ChartData(-10 21 7 -25 9 27;​ /* 1st series. */

3

10 -20 20 10 -20 0) /* 2nd series. */

4

ScatterChart()

5

/* Set up styles. */

6

SymbolStyle(1;​bullet;​6;​1;​#4682b4;​shaded)

7

SymbolStyle(2;​circle;​6;​1;​#4682b4)

8

/* Set up axes. */

9

AxisLine(all;​0)

10

AxisMajorTicks(all;​0)

11

AxisMajorTickLabelOptions(y;​;​-5)

12

/* Set up grid. */

13

MajorGridLineWidths(x;​y;​0.25)

14

MajorGridLineWidths(y;​x;​0)

15

CloseDrawing()

SCATTER_CHART_01

The 1st argument appearanceConstants makes it possible to rotate the chart 90 degrees (appearanceConstants = horizontal), to add shadow (appearanceConstants = shadow) and to add labels (appearanceConstants = label) to the symbols. All options can be combined arbitrarily by using a plus sign "+".

SCATTER_CHART_02
1

OpenDrawing(250;​150)

2

ChartData(-10 21 7 -25 9 27;​ /* 1st series. */

3

10 -20 20 10 -20 0) /* 2nd series. */

4

ScatterChart(shadow+horizontal)

5

/* Set up styles. */

6

SymbolStyle(1;​bullet;​6;​1;​#4682b4;​shaded)

7

SymbolStyle(2;​circle;​6;​1;​#4682b4)

8

ShadowStyle(all;​2 2 3)

9

/* Set up axes. */

10

AxisLine(all;​0)

11

AxisMajorTicks(all;​0)

12

AxisMajorTickLabelOptions(x;​;​;​5)

13

AxisMajorTickLabelOptions(y;​;​-3)

14

/* Set up grid. */

15

MajorGridLineWidths(x;​y;​0)

16

MajorGridLineWidths(y;​x;​0.25)

17

CloseDrawing()

SCATTER_CHART_02

The symbols and shadows can be varied by using the style functions SymbolColorScheme() , SymbolStyle() and ShadowStyle() and the labels by using the five style functions LabelTexts() , LabelStyle() , LabelBackground() , LabelBackgroundOptions() and LabelOptions() .

SCATTER_CHART_03
1

OpenDrawing(250;​150)

2

ChartData(-10 21 7 -25 9 27;​ /* 1st series. */

3

10 -20 20 10 -20 0) /* 2nd series. */

4

ScatterChart(shadow)

5

/* Set up styles. */

6

SymbolStyle(1;​star5;​12;​0;​slateBlue)

7

SymbolStyle(2;​squareHalfTopRight;​10;​1;​darkViolet)

8

ShadowStyle(all;​2 2 3)

9

/* Set up axes. */

10

AxisLine(all;​0)

11

AxisMajorTicks(all;​0)

12

AxisMajorTickLabelOptions(x;​;​;​5)

13

AxisMajorTickLabelOptions(y;​;​-3)

14

/* Set up grid. */

15

MajorGridLineWidths(x;​y;​0.25)

16

MajorGridLineWidths(y;​x;​0)

17

CloseDrawing()

SCATTER_CHART_03
SCATTER_CHART_04
1

OpenDrawing(250;​150)

2

ChartData(25 22 20 25 18 27;​ /* 1st series. */

3

15 5 10 10 7 15) /* 2nd series. */

4

ScatterChart(shadow+label)

5

/* Set up styles. */

6

SymbolStyle(1;​square;​16;​1;​slateBlue;​shaded)

7

SymbolStyle(2;​bullet;​16;​1;​darkYellow;​shaded)

8

ShadowStyle(all;​2 2 3)

9

LabelStyle(1;​Arial;​10;​bold;​white)

10

LabelStyle(2;​Arial;​10;​plain;​#333)

11

LabelOptions(all;​centerCenter;​;​-1)

12

/* Set up axes. */

13

AxisLine(all;​0)

14

AxisMajorTicks(all;​0)

15

AxisMajorTickLabelOptions(x;​;​;​5)

16

AxisMajorTickLabelOptions(y;​;​-5)

17

/* Set up grid. */

18

MajorGridLineWidths(x;​y;​0.25)

19

MajorGridLineWidths(y;​x;​0)

20

CloseDrawing()

SCATTER_CHART_04

For one-dimensional charts it is sometimes advantageous to move the symbols half an interval width so that they do not lie on the interval borders but rather in the middle of the intervals. This can be done by activating the 2nd argument doShiftIntervals = on.

SCATTER_CHART_05
1

OpenDrawing(250;​150)

2

ChartData(25 22 20 25 18 27)

3

ScatterChart(shadow+label;​on)

4

/* Set up styles. */

5

SymbolStyle(1;​circle;​18;​1.5;​darkRed;​;​white)

6

ShadowStyle(all;​2 2 3)

7

LabelStyle(1;​Arial;​10;​plain;​#333)

8

LabelOptions(all;​centerCenter;​;​-1)

9

/* Set up axes. */

10

AxisLine(all;​0)

11

AxisMajorTicks(all;​0)

12

/* Set up grid. */

13

MajorGridLineWidths(x;​y;​0)

14

MajorGridLineWidths(y;​x;​0.25)

15

CloseDrawing()

SCATTER_CHART_05
SCATTER_CHART_06
1

OpenDrawing(250;​150)

2

OpenChart(20;​20;​210;​100;​on)

3

ChartData(32 58 41 23 45 47 42 83 12 73 68)

4

ChartDataOptions(;​-1) /* -1...Sort descending. */

5

ScatterChart(label)

6

/* Set up styles and labels. */

7

SymbolStyle(1;​bullet;​8;​1;​steelBlue;​shaded)

8

LabelStyle(1;​Verdana;​9;​plain;​steelBlue)

9

LabelOptions(all;​topCenter)

10

DropLineStyle(all;​x;​0.25;​steelBlue)

11

/* Set up axes. */

12

Scaling(y;​linear;​0;​100;​10)

13

AxisOptions(y;​none) /* Hide y-axis.  */

14

AxisLine(all;​0) /* Hide axis lines. */

15

AxisMajorTicks(all;​0) /* Hide tick marks. */

16

AxisMajorTickLabelStyle(all;​Verdana;​10;​plain;​#444)

17

GridLocation(all;​none) /* Hide grid. */

18

CloseChart()

19

CloseDrawing()

SCATTER_CHART_06
Scroll to Top