Platforms to show: All Mac Windows Linux Cross-Platform

Back to CDBaseChartMBS class.

Previous items

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
Sets output format options for the next chart output. Currently, only SVG, SVGZ and PDF output formats support output options.
Example

dim c as CDBaseChartMBS // your chart object

// 2x for higher DPI displays
c.setOutputOptions("bmpscale=2")

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 OptionTypeDescription
bmpScaleAttributeRender 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.
dpiAttributeSpecify the factor for conversion from pixel to physical unit. e.g. 196 for double size.

SVG Options
SVG OptionTypeDescription
compressFlagCompressed the SVG, that is, output SVGZ.
bitmapFlagRender the chart as a bitmap and output the bitmap as SVG.
noxmldeclFlagDo not include the xml declaration line "<?xml version="1.0" .... >" in the SVG.
nodoctypeFlagDo not include the document type declaration line "<!DOCTYPE svg PUBLIC .... >" in the SVG.
widthFlag / AttributeSpecifies 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%".
heightFlag / AttributeSpecifies the height attribute of the SVG. See the description on "width" above on how to use it.

PDF Options
PDF OptionTypeDescription
bitmapFlagRender the chart as a bitmap and output the bitmap as PDF.
widthAttributeThe 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.
heightAttributeThe width of the chart in the PDF in pixel unit. See the description on "width" above for how to use it.
pagewidthAttributeThe 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.
pageheightAttributeThe 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.
leftxAttributeThe 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.
topyAttributeThe 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.
dpiAttributeSpecify 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.

ArgumentDefaultDescription
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
Assigns a resource ID to a memory block to allow it to be referenced using a resource path.

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.

ArgumentDefaultDescription
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
Assigns a resource ID to a memory block to allow it to be referenced using a resource path.

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.

ArgumentDefaultDescription
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
Assigns a resource ID to a DrawArea object to allow it to be referenced using a resource path.

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".

ArgumentDefaultDescription
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 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
Sets the border style of the chart to rounded corners.

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.
ArgumentDefaultDescription
extColorFFFFFFThe exterior background color.
r110The radius of the top-left rounded corner in pixels.
r2-1The 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-1The 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-1The 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
Sets the file system search path for loading image files.

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.
ArgumentDefaultDescription
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
Sets the size of the chart.

ArgumentDefaultDescription
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
Sets a thick frame around the chart.

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.

ArgumentDefaultDescription
thickness(Mandatory)The frame thickness.
frameColor-1The frame color. The default value of -1 means the frame color is the same as the outer edge color.
outerEdgeColor-1The 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-1The 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
Same as the other setTransparentColor method, but uses color instead of integer data type for passing color values.

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
Specifies a certain color to mean transparent when creating the image output, or to include alpha transparency channel in the output.

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.
ArgumentDefaultDescription
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
Sets the color palette to transparent colors.

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
Uses the image from the specified file as the wallpaper to repetitively fill the background of the chart.

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.
ArgumentDefaultDescription
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
Sets the names of the week days for date/time formatting purposes.

The default is to use the first 3 characters of the English week day names (Sun, Mon, Tue, ...).
ArgumentDefaultDescription
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
Sets the color palette to white on black colors.

Some examples using this method:

Previous items

The items on this page are in the following plugins: MBS ChartDirector Plugin.


The biggest plugin in space...