AddSlice
AddSlice ( left ; top ; width ; height ; startAngle ; arcAngle ; innerRadii ; fillColor ; fillColorVariant ; borderStroke ; borderColor ; borderColorVariant ; shadowEffect ; shadowColor )
Argument | Type | Range | Default | Note |
---|---|---|---|---|
left | num | -inf..+inf | (required) | |
top | num | -inf..+inf | (required) | |
width | num | 0..inf | (required) | |
height | num | 0..inf | (required) | |
startAngle | num | -360..+360 | 0 | Dimension:[deg] |
arcAngle | num | -360..+360 | 90 | Dimension:[deg] |
innerRadii | num[] | 0..100 | 0 | In % of slice radius |
fillColor | rgba | 0..255 | black | |
fillColorVariant | int | -1..128 | solid | |
borderStroke | num[] | 0..1000 | 0 | Dimension:[pt] |
borderColor | rgba | 0..255 | black | |
borderColorVariant | int | -1..128 | solid | |
shadowEffect | num[] | -1000..1000 | 0 | |
shadowColor | rgba | 0..255 | #888a |
Examples
Description
The AddSlice() function is used to draw oval slices whose fill, border and shadow can be varied. The arguments startAngle and arcAngle are explained in combination with the AddArc() function. The argument innerRadii makes it possible to draw ring-shaped sectors. The inner radii are to be entered in percentage of the outer radius — between 0 (default) and 100. If two inner radii are entered, then the first one is the radius at the begin and the second one the radius at the end of the arc.
| ADD_SLICE_01 |
1 | OpenDrawing(100;100) |
2 | AddSlice(10;10;80;80; |
3 | 90; /* Start angle */ |
4 | 240; /* Arc angle */ |
5 | 0; /* Inner radius */ |
6 | |
7 |
| ADD_SLICE_02 |
1 | OpenDrawing(100;100) |
2 | AddSlice(10;10;80;80; |
3 | 90; /* Start angle */ |
4 | 240; /* Arc angle */ |
5 | 50; /* Inner radius */ |
6 | |
7 |
| ADD_SLICE_03 |
1 | OpenDrawing(100;100) |
2 | AddSlice(10;10;80;80; |
3 | 90; /* Start angle */ |
4 | 240; /* Arc angle */ |
5 | 0; /* Inner radius */ |
6 | 206 222 236;solid; /* Fill */ |
7 | |
8 |
| ADD_SLICE_04 |
1 | OpenDrawing(100;100) |
2 | AddSlice(10;10;80;80; |
3 | 90; /* Start angle */ |
4 | 240; /* Arc angle */ |
5 | 0; /* Inner radius */ |
6 | |
7 | 5.5;paleVioletRed;shaded; /* Border */ |
8 | 3 3 5) /* Shadow */ |
9 |
| ADD_SLICE_05 |
1 | OpenDrawing(100;100) |
2 | AddSlice(10;10;80;80; |
3 | -120; /* Start angle */ |
4 | 240; /* Arc angle */ |
5 | 100 70; /* Inner radii: [start end] */ |
6 | steelBlue) /* Fill */ |
7 |
| ADD_SLICE_06 |
1 | OpenDrawing(100;100) |
2 | AddSlice(10;10;80;80; |
3 | 90; /* Start angle */ |
4 | -360; /* Arc angle */ |
5 | 100 60; /* Inner radii: [start end] */ |
6 | steelBlue;; /* Fill */ |
7 | 0;;; /* Border */ |
8 | 2 2 5;lightGray) /* Shadow */ |
9 |