CurveFitting

CurveFitting ( seriesIndex ;​ type )

Argument Type Range Default Note
seriesIndex int 0..10000 all
type int -5..6 linear
Examples

CurveFitting(all;​linear)

CurveFitting(2;​3) /* Cubic curve. */

Description

The 1st argument seriesIndex in the CurveFitting() function defines which data series the curve fitting is to be calculated for. The 2nd argument type defines the curve function. Six constants are available for this. If the 2nd argument type is not defined, a 1st degree polynomial (straight line) is calculated.

CURVE_FITTING_01
1

OpenDrawing(250;​150)

2

ChartData(15 59 72 12 47 21 52 75 67 95;​ /* x-values. */

3

54 23 7 69 70 94 43 56 85 13) /* y-values. */

4

ScatterChart2D()

5

CurveFitting()

6

/* Set up styles. */

7

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

8

/* Set up axes. */

9

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

10

AxisLine(all;​0)

11

AxisMajorTicks(all;​0)

12

/* Set up grid. */

13

MajorGridLineWidths(all;​all;​0.25)

14

GridFrame(xy;​0.5;​#888)

15

CloseDrawing()

CURVE_FITTING_01
CURVE_FITTING_02
1

OpenDrawing(250;​150)

2

ChartData(57 108 70 125 116 13 63 67 45 121 181 189 201 166 115 105 91 75 99 72 33 29 69 85 162 210 211 256 304 258 274 270 263;​

3

233 229 269 285 362 410 411 456 504 458 474 470 463 257 308 270 325 316 213 263 267 245 321 381 389 401 366 315 305 291 275 299 272)

4

ScatterChart()

5

CurveFitting(1;​1)

6

CurveFitting(2;​6)

7

/* Set up styles. */

8

SymbolStyle(1;​bullet;​3;​1;​#4682b4)

9

SymbolStyle(2;​bullet;​3;​1;​#c002a0)

10

/* Set up axes. */

11

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

12

AxisLine(y;​0)

13

AxisMajorTicks(y;​0)

14

/* Set up grid. */

15

MajorGridLineWidths(x;​y;​0.25)

16

MajorGridLineWidths(y;​x;​0)

17

CloseDrawing()

CURVE_FITTING_02
Scroll to Top