PolarChart
PolarChart ( appearanceConst ; startAngle ; arcAngle )
Argument | Type | Range | Default | Note |
---|---|---|---|---|
appearanceConst | int | 0..127 | default | |
startAngle | num | -360..+360 | 0 | Dimension:[deg] |
arcAngle | num | -360..+360 | 360 | Dimension:[deg] |
Examples
Description
The PolarChart() function makes it possible to draw two-dimensional values in polar coordinates. The 1st data series in the ChartData() function defines the x-values, the 2nd data series the y-values of the first series, the 3rd and 4th data series in ChartData() the x and y-values of the second series, etc. Use the following formula to convert polar coordinates (r,φ) to Carthesian coordinates (x,y):
- x = r cos(φ)
- y = r sin(φ)
| POLAR_CHART_01 |
1 | OpenDrawing(160;160) |
2 | ChartData(5 7 3 -5 -7 -2 -3; /* x-values. */ |
3 | 6 3 -6 -4 2 3 6) /* y-values. */ |
4 | |
5 | /* Set up styles. */ |
6 | FillStyle(1;#4682b420) |
7 | BorderStyle(1;poly;1;#4682b4) |
8 | /* Set up axes. */ |
9 | ScalingOptions(;;;on) /* Hide "0" */ |
10 | |
11 | AxisMajorTicks(all;0) |
12 | /* Set up grid. */ |
13 | MajorGridLineWidths(all;all;0.25) |
14 | |
15 |
The 1st argument appearanceConstants makes it possible to choose between an elliptical form (appearanceConstants = oval), i.e. the entire available area can be made use of, or a circular shape. As the default, all polar charts are drawn circular. In addition, symbols (appearanceConstants = symbol), shadow (appearanceConstants = shadow) and labels (appearanceConstants = label) can be added to charts. All options can be combined by using a plus sign "+". The fills, borders, symbols and shadows can be varied by using the style functions FillColorScheme() , FillStyle() , PictureStyle() , BorderColorScheme() , BorderStyle() , SymbolColorScheme() , SymbolStyle() and ShadowStyle() and the labels by using the five style functions LabelTexts() , LabelStyle() , LabelBackground() , LabelBackgroundOptions() and LabelOptions() .
| POLAR_CHART_02 |
1 | OpenDrawing(160;160) |
2 | ChartData(5 7 3 -5 -7 -2 -3; /* x-values. */ |
3 | 6 3 -6 -4 2 3 6) /* y-values. */ |
4 | |
5 | /* Set up styles. */ |
6 | FillStyle(1;#4682b420) |
7 | BorderStyle(1;poly;1.5;#4682b4) |
8 | SymbolStyle(1;circle;6;1;#4682b4;;white) |
9 | ShadowStyle(all;2 2 3) |
10 | /* Set up axes. */ |
11 | ScalingOptions(;;;on) /* Hide "0" */ |
12 | |
13 | AxisMajorTicks(all;0) |
14 | /* Set up grid. */ |
15 | MajorGridLineWidths(all;all;0.25) |
16 | |
17 |
| POLAR_CHART_03 |
1 | OpenDrawing(280;180) |
2 | ChartData(5 7 3 -5 -7 -2 -3; /* 1st series: x-values. */ |
3 | 6 3 -6 -4 2 3 6; /* 1st series: y-values. */ |
4 | 1 4 0 -4 -4 -5; /* 2nd series: x-values. */ |
5 | 7 3 -7 -7 0 6) /* 2nd series: y-values. */ |
6 | |
7 | /* Set up styles. */ |
8 | FillStyle(1;#4682b420) |
9 | |
10 | BorderStyle(1;poly;1.5;#4682b4) |
11 | BorderStyle(2;smooth;1;#c002a0) |
12 | SymbolStyle(1;none) |
13 | SymbolStyle(2;circle;5;1;#c002a0;;white) |
14 | /* Set up axes. */ |
15 | |
16 | ScalingOptions(;;;on) /* Hide "0" */ |
17 | |
18 | AxisMajorTicks(all;0) |
19 | /* Set up grid. */ |
20 | MajorGridLineWidths(all;all;0.25) |
21 | |
22 |
As the default, the points of a series are connected to a polygon. By suppressing both the fill and border using FillStyle(;none) and BorderStyle(;none), it is possible to represent the chart values solely by using symbols.
| POLAR_CHART_04 |
1 | OpenDrawing(280;180) |
2 | ChartData(5 7 3 -5 -7 -2 -3; /* x-values. */ |
3 | 6 -2 -6 -4 3 2 7) /* y-values. */ |
4 | |
5 | /* Set up styles. */ |
6 | |
7 | BorderStyle(1;none) |
8 | SymbolStyle(1;bullet;5;1;#4682b4;shaded) |
9 | /* Set up axes. */ |
10 | |
11 | ScalingOptions(;;;on) /* Hide "0" */ |
12 | |
13 | AxisMajorTicks(all;6;0.25;gray;;center) |
14 | AxisLabelText(all;"|u|˚") |
15 | /* Set up grid. */ |
16 | GridLocation(all;none) /* Hide grid. */ |
17 |
The texts for the axis labels are entered by using the AxisLabelText() function. As the default, the axis labels start at the top (12 o'clock) and run clockwise over a range of 360°. By using the arguments startAngle and arcAngle, the position of the 0 degrees line as well as the direction and range (arc angle) of the grid can be defined. By defining a start angle greater than zero all axes are moved clockwise; by entering a negative start angle they are moved counter-clockwise. All angles are to be entered within the range of ±360 degrees. A start angle of 0 degrees is at the top (12 o'clock), of 90 degrees is on the right (3 o'clock) and of -90 degrees is on the left (9 o'clock).
| POLAR_CHART_05 |
1 | OpenDrawing(280;180) |
2 | ChartData(5 7 3 -5 -7 -2 -3; /* x-values. */ |
3 | 6 3 -6 -4 2 3 6) /* y-values. */ |
4 | PolarChart(oval+shadow;90) |
5 | /* Set up styles. */ |
6 | FillStyle(1;#ffca5f) |
7 | BorderStyle(1;poly;1.5;#bd9648) |
8 | ShadowStyle(all;2 2 3) |
9 | /* Set up axes. */ |
10 | |
11 | ScalingOptions(;;;on) /* Hide "0" */ |
12 | |
13 | AxisMajorTicks(all;0) |
14 | AxisLabelText(all;"|u|˚") |
15 | |
16 | /* Set up grid. */ |
17 | |
18 | MajorGridLineWidths(all;all;0.25) |
19 | |
20 |
| POLAR_CHART_06 |
1 | OpenDrawing(280;180) |
2 | ChartData(5 7 3 -5 -7 -2 -3; /* x-values. */ |
3 | 6 3 -6 -4 2 3 6) /* y-values. */ |
4 | /* 90...0-degrees-line on the right. */ |
5 | /* -360...degrees run counter-clockwise. */ |
6 | PolarChart(oval+shadow;90;-360) |
7 | /* Set up styles. */ |
8 | FillStyle(1;#ffca5f20) |
9 | BorderStyle(1;poly;1.5;#bd9648) |
10 | ShadowStyle(all;2 2 3) |
11 | /* Set up axes. */ |
12 | |
13 | ScalingOptions(;;;on) /* Hide "0" */ |
14 | |
15 | AxisMajorTicks(all;0) |
16 | AxisLabelText(all;"|u|˚") |
17 | /* Set up grid. */ |
18 | MajorGridLineWidths(all;all;0.25) |
19 | |
20 |