BackgroundOptions

New in version 5.0

BackgroundOptions ( cornerRadius ;​ padding )

Argument Type Range Default Note
cornerRadius num[] 0..1000 0 Absolute in px or in % of drawing diagonal
padding num[] 0..1000 2% Absolute in px or in % of drawing diagonal
Examples
Description

The first argument cornerRadius can have up to four corner radii (topLeft, topRight, bottomRight and bottomLeft). As the second argument padding, it is possible to define the padding for each side of an element (top, right, bottom and left). Refer to the mnemonic “TRouBLe" as an easy way to remember the order of paddings. The cornerRadius and padding can be entered absolute in pixels or relative as percentage of the diagonal of the drawing area.
Please note, background option functions are only enabled in combination with the corresponding background function. For example:


OpenDrawing(800;​600)

/* ... */

/* Chart legend. */

LegendTitle("Legend")

LegendTexts("Item 1";​"Item 2";​"Item 3")

LegendStyle(Verdana;​10;​plain)

LegendOptions(bottomCenter)

LegendBackgroundOptions(10;​10) /* No effect, function LegendBackground() is missed. */

/* ... */

CloseDrawing()


OpenDrawing(800;​600)

/* ... */

/* Chart legend. */

LegendTitle("Legend")

LegendTexts("Item 1";​"Item 2";​"Item 3")

LegendStyle(Verdana;​10;​plain)

LegendOptions(bottomCenter)

LegendBackground(#f3f6f2;​0;​0;​;​;​2 2 2;​lightGray)

LegendBackgroundOptions(10;​10) /* Correct, function LegendBackground() is called. */

/* ... */

CloseDrawing()

BACKGROUND_OPTIONS_01
1

OpenDrawing(250;​150)

2

OpenView(80;​40;​150;​90)

3

ChartData(7 5 4 2 1)

4

BarChart()

5

/* Set up styles. */

6

FillStyle(1;​#4682b4)

7

BorderStyle(all;​none)

8

/* Set up axes. */

9

AxisLine(all;​0)

10

AxisMajorTicks(all;​0)

11

/* Set up grid and background. */

12

MajorGridLineWidths(y;​x;​0)

13

MajorGridLineColors(x;​y;​#e1d9c9)

14

Background(#f7f6f1;​solid;​0.5;​#a58b5c;​solid;​0 1 5)

15

BackgroundOptions(4)

16

CloseView()

17

Background(white;​solid;​1.5;​#a58b5c;​;​2 2 3;​lightGray)

18

BackgroundOptions(0 15 0 0) /* Border with a top right rounded corner. */

19

CloseDrawing()

BACKGROUND_OPTIONS_01
Scroll to Top