Platforms to show: All Mac Windows Linux Cross-Platform
CDBaseChartMBS.setBackground(colorvalue as Integer, edgeColor as Integer = &hff000000, raisedEffect as Integer = 0)
Function:
Sets the background color, border color and 3D border effect of the chart.
Notes:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes:
Argument | Default | Description |
color | (Mandatory) | The background color of the chart. |
edgeColor | Transparent | The border color of the chart. |
raisedEffect | 0 | The 3D border width. For positive values, the border will appear raised. For negative values, the border will appear depressed. A zero value means the border will appear flat. |
See also:
CDBaseChartMBS.setBgImage(img as string, align as Integer = 5)
Function:
Uses the image from the specified file as the background image of the chart.
Notes:
ChartDirector will automatically detect the image file format using the file extension, which must either png, jpg, jpeg, gif, wbmp or wmp (case insensitive).
Please refer to BaseChart.setSearchPath on the directory that ChartDirector will search for the file.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes:
ChartDirector will automatically detect the image file format using the file extension, which must either png, jpg, jpeg, gif, wbmp or wmp (case insensitive).
Please refer to BaseChart.setSearchPath on the directory that ChartDirector will search for the file.
Argument | Default | Description |
img | (Mandatory) | The image file that is used as the background image of the chart. |
align | Center | The alignment of the background image relative to the chart. See Alignment Specification for supported alignment types. |
CDBaseChartMBS.setBorder(colorvalue as color)
Function:
Same as the other setBorder method, but uses color instead of integer data type for passing color values.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
CDBaseChartMBS.setBorder(colorvalue as Integer)
Function:
Deprecated. Use SetBackground instead.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
CDBaseChartMBS.setColor(paletteEntry as Integer, colorvalue as color)
Function:
Same as the other setColor method, but uses color instead of integer data type for passing color values.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
CDBaseChartMBS.setColor(paletteEntry as Integer, colorvalue as Integer)
Function:
Change the color at the specified position in the palette.
Notes:
See Color Specification on how colors are represented in ChartDirector.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes:
See Color Specification on how colors are represented in ChartDirector.
Argument | Default | Description |
paletteEntry | (Mandatory) | An index to the palette. |
color | (Mandatory) | The color to change to. |
See also:
CDBaseChartMBS.setColors(numbers() as color)
Function:
Same as the other setColors method, but uses color instead of integer data type for passing color values.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
CDBaseChartMBS.setColors(numbers() as Integer)
Function:
Change the colors in the palette.
Notes:
See Color Specification on how colors are represented in ChartDirector.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes:
See Color Specification on how colors are represented in ChartDirector.
Argument | Default | Description |
colors | (Mandatory) | An array of colors to change to. |
See also:
CDBaseChartMBS.setColors(paletteEntry as Integer, numbers() as color)
Function:
Same as the other setColors method, but uses color instead of integer data type for passing color values.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
CDBaseChartMBS.setColors(paletteEntry as Integer, numbers() as Integer)
Function:
Change the colors in the palette, starting from the specified position in the palette.
Notes:
See Color Specification on how colors are represented in ChartDirector.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes:
See Color Specification on how colors are represented in ChartDirector.
Argument | Default | Description |
paletteEntry | (Mandatory) | An index to the palette to start changing the colors. |
colors | (Mandatory) | An array of colors to change to. |
See also:
CDBaseChartMBS.setDefaultColors(paletteEntry as Integer = 0)
Function:
Sets the default colors.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
CDBaseChartMBS.setDefaultFonts(normal as string, bold as string, italic as string, boldItalic as string)
Function:
Sets the defaults for normal, bold, italic and bold-italic fonts.
Example:
Notes:
See Font Specification for details on various font attributes.
See font specification here:
http://www.monkeybreadsoftware.net/faq-chartdirectorfontspecification.shtml
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
dim Chart as CDBaseChartMBS // your chart
#If TargetARM And TargetLinux Then
// use specific fonts on Linux on Raspberry Pi
Call Chart.setDefaultFonts("/usr/share/fonts/truetype/piboto/PibotoLt-Regular.ttf","/usr/share/fonts/truetype/piboto/PibotoLtBold.ttf","/usr/share/fonts/truetype/piboto/PibotoLtItalic.ttf","/usr/share/fonts/truetype/piboto/PibotoLtBoldItalic.ttf")
#EndIf
See Font Specification for details on various font attributes.
Argument | Default | Description |
normal | (Mandatory) | The default normal font. This is the same as the first font in the font table. |
bold | "" | The default bold font. This is the same as the second font in the font table. An empty string means the default is unchanged. |
italic | "" | The default italic font. This is the same as the third font in the font table. An empty string means the default is unchanged. |
boldItalic | "" | The default bold-italic font. This is the same as the fourth font in the font table. An empty string means the default is unchanged. |
See font specification here:
http://www.monkeybreadsoftware.net/faq-chartdirectorfontspecification.shtml
CDBaseChartMBS.setDropShadow(ColorValue as color, OffsetX as Integer = 5, OffsetY as Integer = &h7fffffff, blurRadius as Integer = 5)
Function:
Same as the other setDropShadow method, but uses color instead of integer data type for passing color values.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
Some examples using this method:
CDBaseChartMBS.setDropShadow(ColorValue as Integer = &hAAAAAA, OffsetX as Integer = 5, OffsetY as Integer = &h7fffffff, blurRadius as Integer = 5)
Function:
Adds a drop shadow to the chart.
Notes:
The drop shadow effect is created using a single color representation of the non-transparent part of the chart, offsetted by an amount, and put under the chart. The drop shadow can be blurred to create a soft drop shadow effect.
Note that adding a drop shadow will increase the width and height of the chart image so as to accommodate the drop shadow.
Because the drop shadow is located exterior to the original chart, it uses an exterior background color different from the background color of the original chart. The exterior background color is by default white, and can be configured with CDBaseChartMBS.setRoundedFrame.
Arguments:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 9.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes:
The drop shadow effect is created using a single color representation of the non-transparent part of the chart, offsetted by an amount, and put under the chart. The drop shadow can be blurred to create a soft drop shadow effect.
Note that adding a drop shadow will increase the width and height of the chart image so as to accommodate the drop shadow.
Because the drop shadow is located exterior to the original chart, it uses an exterior background color different from the background color of the original chart. The exterior background color is by default white, and can be configured with CDBaseChartMBS.setRoundedFrame.
Arguments:
Argument | Default | Description |
color | AAAAAA | The color of the drop shadow. |
offsetX | 5 | The x offset of the drop shadow. |
offsetY | 7fffffff | The y offset of the drop shadow. 7fffffff means it is the same as the x offset. |
blurRadius | 5 | The blur radius of the drop shadow. |
See also:
CDBaseChartMBS.setFontTable(index as Integer, font as string)
Function:
Sets an entry in the font table to the specified font name.
Notes:
The first 4 fonts in the font table have special significance. They are the defaults for normal, bold, italic and bold-italic fonts.
See Font Specification for details on various font attributes.
See font specification here:
http://www.monkeybreadsoftware.net/faq-chartdirectorfontspecification.shtml
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes:
The first 4 fonts in the font table have special significance. They are the defaults for normal, bold, italic and bold-italic fonts.
See Font Specification for details on various font attributes.
Argument | Default | Description |
index | (Mandatory) | An index to the font table, starting from 0. |
font | (Mandatory) | The font name to be put into the font table. |
See font specification here:
http://www.monkeybreadsoftware.net/faq-chartdirectorfontspecification.shtml
CDBaseChartMBS.setMonthNames(names() as string)
Function:
Sets the names of the months for date/time formatting purposes.
Notes:
The default is to use the first 3 characters of the English month names (Jan, Feb, Mar ...).
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes:
The default is to use the first 3 characters of the English month names (Jan, Feb, Mar ...).
Argument | Default | Description |
names | (Mandatory) | An array of 12 text strings to be used as the month names. |
CDBaseChartMBS.setNumberFormat(thousandSeparator as string = "~", decimalPointChar as string = ".", signChar as string = "-")
Function:
Sets the characters used for thousand separator, decimal point, and negative sign.
Notes:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes:
Argument | Default | Description |
thousandSeparator | '~' | The thousand separator. Use '~' to mean no thousand separator. |
decimalPointChar | '.' | The decimal point character. |
signChar | '-' | The negative sign character. |
CDBaseChartMBS.setOutputOptions(options as string)
Function:
Sets output format options for the next chart output. Currently, only SVG, SVGZ and PDF output formats support output options.
Notes:
An output option can be a flag (such as "compress") or an attribute-value pair (such as "width=800"). Multiple output options can be joined using semicolons as delimiters.
SVG Options
PDF Options
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 15.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes:
An output option can be a flag (such as "compress") or an attribute-value pair (such as "width=800"). Multiple output options can be joined using semicolons as delimiters.
SVG Options
SVG Option | Type | Description |
compress | Flag | Compressed the SVG, that is, output SVGZ. |
bitmap | Flag | Render the chart as a bitmap and output the bitmap as SVG. |
noxmldecl | Flag | Do not include the xml declaration line "<?xml version="1.0" .... >" in the SVG. |
nodoctype | Flag | Do not include the document type declaration line "<!DOCTYPE svg PUBLIC .... >" in the SVG. |
width | Flag / Attribute | Specifies the width attribute of the SVG. By default, ChartDirector will not include the width or height attribute in the SVG output. In this case, the SVG is variable in size and would assume the size of its container. For example, if the SVG is inside a <DIV> block in a web page, it will assume the size of the DIV block. If the "width" option is used as a flag, ChartDirector will include the width attribute in the SVG and set it to the chart width. If the "width" option is used as an attribute (such as "width=800"), ChartDirector will include the width attribute in the SVG and set it to the specified value. The specified value should be some text that is valid as SVG width. Examples are "100" and "75%". |
height | Flag / Attribute | Specifies the height attribute of the SVG. See the description on "width" above on how to use it. |
PDF Options
PDF Option | Type | Description |
bitmap | Flag | Render the chart as a bitmap and output the bitmap as PDF. |
width | Attribute | The width of the chart in the PDF in pixel unit. By default, ChartDirector will use the pixel width of the chart as the width of the chart in PDF. The "width" attribute can be used to specify an alternative value. The value must be a number. |
height | Attribute | The width of the chart in the PDF in pixel unit. See the description on "width" above for how to use it. |
pagewidth | Attribute | The page width in pixel unit. By default, ChartDirector will set the page width to the same width as the chart. The "pagewidth" attribute can be used to specify an alternative value. The value must be a number. |
pageheight | Attribute | The page height in pixel unit. By default, ChartDirector will set the page height to the same height as the chart. The "pageheight" attribute can be used to specify an alternative value. The value must be a number. |
leftx | Attribute | The x coordinate of the left side of the chart within the page in pixel unit. By default, ChartDirector will center the chart in the page. The "leftx" attribute can be used to specify an alternative horizontal position. The coordinate must be a number. |
topy | Attribute | The y coordinate of the top side of the chart within the page in pixel unit. By default, ChartDirector will center the chart in the page. The "topy" attribute can be used to specify an alternative vertical position. The coordinate must be a number. |
dpi | Attribute | Specify the factor for conversion from pixel to physical unit. The PDF viewer will convert the pixel unit into physical unit (eg. inches) so that it can be layout on paper or other physical media. The default conversion factor for the chart is 96 pixels per inch. The "dpi" attribute can be used to specify an alternative value. The value must be a number. |
Argument | Default | Description |
options | (Mandatory) | A list of options delimited by semicolons. |
CDBaseChartMBS.setResource(id as string, data as MemoryBlock)
Function:
Assigns a resource ID to a memory block to allow it to be referenced using a resource path.
Notes:
Many ChartDirector features, such as BaseChart.setBgImage and the <*img*> tag in CDML, expect a file or resource path for loading an image. If the image happens to be in memory, such as if the image is retrieved from a database, setResource can be used to assign a resource ID to the memory. It can then be referenced using "@/res_id", in which res_id is the resource ID.
The assigned resource ID is only valid for the DrawArea object of which this method is called. Use setResourceGlobal to assign a resource ID that is valid for all ChartDirector objects.
This method stores only a pointer to the memory. It does not copy the memory. You must ensure the memory contains valid content for as long as the resource is being used.
While ChartDirector does not copy the data, the MBS Plugin will put the resources in a dictionary to make sure they stay available till the chart is destroyed and avoid a crash.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 18.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes:
Many ChartDirector features, such as BaseChart.setBgImage and the <*img*> tag in CDML, expect a file or resource path for loading an image. If the image happens to be in memory, such as if the image is retrieved from a database, setResource can be used to assign a resource ID to the memory. It can then be referenced using "@/res_id", in which res_id is the resource ID.
The assigned resource ID is only valid for the DrawArea object of which this method is called. Use setResourceGlobal to assign a resource ID that is valid for all ChartDirector objects.
This method stores only a pointer to the memory. It does not copy the memory. You must ensure the memory contains valid content for as long as the resource is being used.
Argument | Default | Description |
id | (Mandatory) | The resource ID to be used to reference the memory image. |
data | (Mandatory) | The memory that the image occupies. |
While ChartDirector does not copy the data, the MBS Plugin will put the resources in a dictionary to make sure they stay available till the chart is destroyed and avoid a crash.
See also:
CDBaseChartMBS.setResource(id as string, data as string)
Function:
Assigns a resource ID to a memory block to allow it to be referenced using a resource path.
Notes:
Many ChartDirector features, such as BaseChart.setBgImage and the <*img*> tag in CDML, expect a file or resource path for loading an image. If the image happens to be in memory, such as if the image is retrieved from a database, setResource can be used to assign a resource ID to the memory. It can then be referenced using "@/res_id", in which res_id is the resource ID.
The assigned resource ID is only valid for the DrawArea object of which this method is called. Use setResourceGlobal to assign a resource ID that is valid for all ChartDirector objects.
This method stores only a pointer to the memory. It does not copy the memory. You must ensure the memory contains valid content for as long as the resource is being used.
While ChartDirector does not copy the data, the MBS Plugin will put the resources in a dictionary to make sure they stay available till the chart is destroyed and avoid a crash.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 18.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes:
Many ChartDirector features, such as BaseChart.setBgImage and the <*img*> tag in CDML, expect a file or resource path for loading an image. If the image happens to be in memory, such as if the image is retrieved from a database, setResource can be used to assign a resource ID to the memory. It can then be referenced using "@/res_id", in which res_id is the resource ID.
The assigned resource ID is only valid for the DrawArea object of which this method is called. Use setResourceGlobal to assign a resource ID that is valid for all ChartDirector objects.
This method stores only a pointer to the memory. It does not copy the memory. You must ensure the memory contains valid content for as long as the resource is being used.
Argument | Default | Description |
id | (Mandatory) | The resource ID to be used to reference the memory image. |
data | (Mandatory) | The memory that the image occupies. |
While ChartDirector does not copy the data, the MBS Plugin will put the resources in a dictionary to make sure they stay available till the chart is destroyed and avoid a crash.
See also:
CDBaseChartMBS.setResource(id as string, DataArea as CDDrawAreaMBS)
Function:
Assigns a resource ID to a DrawArea object to allow it to be referenced using a resource path.
Notes:
This method is the same DrawArea.setResource, except that it assigns the resource ID to a CDBaseChartMBS object instead of a memory image. This allows the CDBaseChartMBS object to be reference as an image resource using "@/res_id".
While ChartDirector does not copy the draw area, the MBS Plugin will put the resources in a dictionary to make sure they stay available till the chart is destroyed and avoid a crash.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 18.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes:
This method is the same DrawArea.setResource, except that it assigns the resource ID to a CDBaseChartMBS object instead of a memory image. This allows the CDBaseChartMBS object to be reference as an image resource using "@/res_id".
Argument | Default | Description |
id | (Mandatory) | The resource ID to be used to reference the DrawArea object. |
drawArea | (Mandatory) | The CDDrawAreaMBS object to be used as a resource. |
While ChartDirector does not copy the draw area, the MBS Plugin will put the resources in a dictionary to make sure they stay available till the chart is destroyed and avoid a crash.
See also:
CDBaseChartMBS.setRoundedFrame(extColor as color, r1 as Integer = 10, r2 as Integer = -1, r3 as Integer = -1, r4 as Integer = -1)
Function:
Same as the other setRoundedFrame method, but uses color instead of integer data type for passing color values.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
Some examples using this method:
- /ChartDirector/ChartDirector Control
- /ChartDirector/ChartDirector Control for Web
- /ChartDirector/ChartDirector Control Retina
- /ChartDirector/Place PDF Chart with DynaPDF
- /ChartDirector/roundmeter
- /ChartDirector/roundmeter with control
- /ChartDirector/roundmeters with animation
- /ChartDirector/semicirclemeter
- /ChartDirector/simplePie with DynaPDF
- /ChartDirector/wideameter
CDBaseChartMBS.setRoundedFrame(extColor as Integer = &hFFFFFF, r1 as Integer = 10, r2 as Integer = -1, r3 as Integer = -1, r4 as Integer = -1)
Function:
Sets the border style of the chart to rounded corners.
Notes:
The underlying drawing surface for a chart is always rectangular. When rounded corners are used, part of the drawing surface (the regions external to the rounded corners) will be outside the chart border. The extColor argument specifies the color to be used for the external regions. Typically, it is set to the same color as the background the container that will be hosting the chart.
For example, in a web page, the extColor may be set to the same color as the web page background.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes:
The underlying drawing surface for a chart is always rectangular. When rounded corners are used, part of the drawing surface (the regions external to the rounded corners) will be outside the chart border. The extColor argument specifies the color to be used for the external regions. Typically, it is set to the same color as the background the container that will be hosting the chart.
For example, in a web page, the extColor may be set to the same color as the web page background.
Argument | Default | Description |
extColor | FFFFFF | The exterior background color. |
r1 | 10 | The radius of the top-left rounded corner in pixels. |
r2 | -1 | The radius of the top-right rounded corner in pixels. The default value of -1 means it is the same as the radius of the top-left corner. |
r3 | -1 | The radius of the bottom-right rounded corner in pixels. The default value of -1 means it is the same as the radius of the top-left corner. |
r4 | -1 | The radius of the bottom-left rounded corner in pixels. The default value of -1 means it is the same as the radius of the top-left corner. |
See also:
CDBaseChartMBS.setSearchPath(path as string)
Function:
Sets the file system search path for loading image files.
Notes:
The plugin uses folderitems for most file operations, so this method is not needed for most operations.
Several ChartDirector operations involve loading image files. Examples are wallpapers (BaseChart.setWallpaper), background images (BaseChart.setBgImage and PlotArea.setBackground2), user-defined symbols (DataSet.setDataSymbol2) or for embedding images in text using ChartDirector Mark Up Language.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes:
The plugin uses folderitems for most file operations, so this method is not needed for most operations.
Several ChartDirector operations involve loading image files. Examples are wallpapers (BaseChart.setWallpaper), background images (BaseChart.setBgImage and PlotArea.setBackground2), user-defined symbols (DataSet.setDataSymbol2) or for embedding images in text using ChartDirector Mark Up Language.
Argument | Default | Description |
path | (Mandatory) | A list of directories, separated with the path separator of your operating system (";" for Windows, ":" for Linux/UNIX). |
CDBaseChartMBS.setSize(width as Integer, height as Integer)
Function:
Sets the size of the chart.
Notes:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes:
Argument | Default | Description |
width | (Mandatory) | The width of the chart in pixels. |
height | (Mandatory) | The height of the chart in pixels. |
CDBaseChartMBS.setThickFrame(thickness as Integer, frameColor as Integer = -1, outerEdgeColor as Integer = -1, innerEdgeColor as Integer = -1)
Function:
Sets a thick frame around the chart.
Notes:
The thick frame can have 3 colors for the frame itself, the outer edge and the inner edge.
In some applications, the frame color may be similar to the external background color. An common example is a "silver" frame (which is actually a light grey gradient) against a white background. In this case, the frame effect may look less than optimal. An outer edge of different color (such as darker grey) can often help to highlight the frame. Similarly, if the frame color is similar to the chart background, an inner edge of different color may help to improve the frame effect.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 15.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes:
The thick frame can have 3 colors for the frame itself, the outer edge and the inner edge.
In some applications, the frame color may be similar to the external background color. An common example is a "silver" frame (which is actually a light grey gradient) against a white background. In this case, the frame effect may look less than optimal. An outer edge of different color (such as darker grey) can often help to highlight the frame. Similarly, if the frame color is similar to the chart background, an inner edge of different color may help to improve the frame effect.
Argument | Default | Description |
thickness | (Mandatory) | The frame thickness. |
frameColor | -1 | The frame color. The default value of -1 means the frame color is the same as the outer edge color. |
outerEdgeColor | -1 | The outer edge color. The default value of -1 means the outer edge color is the same as the current edge color, which can be set in the chart constructor or in BaseChart.setBackground. |
innerEdgeColor | -1 | The inner edge color. The default value of -1 means the inner edge color is the same as the frame color. |
CDBaseChartMBS.setTransparentColor(c as color)
Function:
Same as the other setTransparentColor method, but uses color instead of integer data type for passing color values.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
CDBaseChartMBS.setTransparentColor(c as Integer)
Function:
Specifies a certain color to mean transparent when creating the image output, or to include alpha transparency channel in the output.
Notes:
Alpha transparency: In addition to red, green and blue levels, there is a transparency level associated with each pixel, which can range from completely transparent to completely opaque. The data associated with the transparency information is called the alpha channel.
Single color transparency: The image itself has no alpha channel, but a certain color is used to mean completely transparent. For internal drawing, ChartDirector always use alpha transparency. However, when outputting the image as an image file, ChartDirector by default will remove the alpha channel to reduce image size. It is because many image displaying software do not support alpha transparency. For example, the IE browser only supports single color transparency but not alpha transparency.
If you want to use single color transparency in the output, you may specify the transparent color as the argument to the setTransparentColor method. Note that only GIF and PNG can support single color transparency. JPEG, BMP and WBMP cannot support transparency at all.
If you do want to keep the alpha channel in final output, you may pass -1 as the argument to setTransparentColor. Note that the only image format that can support alpha transparency is PNG.
One important thing to note is that the IE browser (and possibly many image displaying software) only supports single color transparency for palette based images with up to 256 colors, but not for true color images. For this reason, if single color transparency is used, ChartDirector will automatically reduce the image to 256 colors if it has more than 256 colors. This may result in lost of image quality, especially if the image contains gradient colors.
Therefore, due to the limitations of the current generations of image displaying software, for highest image quality, sometimes it may be beneficial to not using transparency in image output, but to set the image background color to the same color as the container background.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes:
Alpha transparency: In addition to red, green and blue levels, there is a transparency level associated with each pixel, which can range from completely transparent to completely opaque. The data associated with the transparency information is called the alpha channel.
Single color transparency: The image itself has no alpha channel, but a certain color is used to mean completely transparent. For internal drawing, ChartDirector always use alpha transparency. However, when outputting the image as an image file, ChartDirector by default will remove the alpha channel to reduce image size. It is because many image displaying software do not support alpha transparency. For example, the IE browser only supports single color transparency but not alpha transparency.
If you want to use single color transparency in the output, you may specify the transparent color as the argument to the setTransparentColor method. Note that only GIF and PNG can support single color transparency. JPEG, BMP and WBMP cannot support transparency at all.
If you do want to keep the alpha channel in final output, you may pass -1 as the argument to setTransparentColor. Note that the only image format that can support alpha transparency is PNG.
One important thing to note is that the IE browser (and possibly many image displaying software) only supports single color transparency for palette based images with up to 256 colors, but not for true color images. For this reason, if single color transparency is used, ChartDirector will automatically reduce the image to 256 colors if it has more than 256 colors. This may result in lost of image quality, especially if the image contains gradient colors.
Therefore, due to the limitations of the current generations of image displaying software, for highest image quality, sometimes it may be beneficial to not using transparency in image output, but to set the image background color to the same color as the container background.
Argument | Default | Description |
c | (Mandatory) | The color that is designated as the transparent color. If -1 is used, the full alpha transparency channel will be included in the final output. |
See also:
CDBaseChartMBS.setTransparentColors(paletteEntry as Integer = 0)
Function:
Sets the color palette to transparent colors.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Some examples using this method:
CDBaseChartMBS.setWallpaper(img as folderitem)
Function:
Uses the image from the specified file as the wallpaper to repetitively fill the background of the chart.
Notes:
ChartDirector will automatically detect the image file format using the file extension, which must either png, jpg, jpeg, gif, wbmp or wmp (case insensitive).
Please refer to BaseChart.setSearchPath on the directory that ChartDirector will search for the file.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes:
ChartDirector will automatically detect the image file format using the file extension, which must either png, jpg, jpeg, gif, wbmp or wmp (case insensitive).
Please refer to BaseChart.setSearchPath on the directory that ChartDirector will search for the file.
Argument | Default | Description |
img | (Mandatory) | The image file that is used as the background wallpaper of the chart. |
Some examples using this method:
The items on this page are in the following plugins: MBS ChartDirector Plugin.
Feedback: Report problem or ask question.
