Platforms to show: All Mac Windows Linux Cross-Platform
Back to CDBaseChartMBS class.
CDBaseChartMBS.setOutputOptions(options as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 15.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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.
Raster Image Options (PNG, JPG, GIF, BMP or desktop display output)
Raster Image Option | Type | Description |
bmpScale | Attribute | Render the chart with a scale factor. For example, "bmpScale=1.5" means the chart size will be 1.5 times of the original. The supported bmpScale is 0.1 to 4. |
dpi | Attribute | Specify the factor for conversion from pixel to physical unit. e.g. 196 for double size. |
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)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 18.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 18.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 18.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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)
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)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 15.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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)
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)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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)
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)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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:
CDBaseChartMBS.setWeekDayNames(names() as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The default is to use the first 3 characters of the English week day names (Sun, Mon, Tue, ...).
Argument | Default | Description |
names | (Mandatory) | An array of 7 text strings to be used as the week day names. |
CDBaseChartMBS.setWhiteOnBlackColors(paletteEntry as Integer = 0)
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:
The items on this page are in the following plugins: MBS ChartDirector Plugin.