Platforms to show: All Mac Windows Linux Cross-Platform

Back to CDBaseChartMBS class.

CDBaseChartMBS.Constructor   Private

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 15.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The private constructor.

CDBaseChartMBS.dashLineColor(colorvalue as color, patternCode as Integer = &h0505) as Integer

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 dashLineColor method, but uses color instead of integer data type for passing color values.

See also:

CDBaseChartMBS.dashLineColor(colorvalue as Integer, patternCode as Integer = &h0505) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
A constant equals to 0505 (in hex) to represent a dash line pattern for use in dash colors.

See Color Specification on how colors are represented in ChartDirector.

See also:

CDBaseChartMBS.Destructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 9.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The destructor for the base chart.

CDBaseChartMBS.enableVectorOutput   Deprecated

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 9.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This item is deprecated and should no longer be used.
Enables true vector graphics output.

By default, when creating the output image, ChartDirector draws directly onto an output buffer representing the bitmap of the image. For example, for a chart 800 x 600 pixels in size, the output buffer may represent a 800 x 600 bitmap. The output buffer size is unchanged no matter how many items are drawn onto it. Even if the output contains 1 million elements (eg. 1 million symbols), the size of the output buffer is still the same.

On the other hand, a true vector output is indefinitely scalable and can be considered as having infinite resolution. To produce a true vector output, it is necessary to remember the graphics operations for every element in the output buffer. The output buffer size is therefore proportional to the number of elements to draw.

This method tells ChartDirector that it needs to remember the graphics operations to prepare for true vector output. If true vector output is needed, this method should be called immediately after creating the BaseChart object.

If this method is not called, and a vector graphics output format is used (such as SVG), instead of a true vector output, ChartDirector will output a raster image using the vector graphics format. (Most vector graphics formats support embedded raster images.)

CDBaseChartMBS.formatValue(value as Double, formatstring as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Formats a number/date using the ChartDirector formatting syntax as is in Parameter Substitution and Formatting.

ArgumentDefaultDescription
value(Mandatory)The value to be formatted.
formatString(Mandatory)The format string, using {value} to denote the value. For example, ${value|2,} can be used to format the value to 2 decimal points, using "," as the thousand separator, and with a '$' sign in front.

Some examples using this method:

CDBaseChartMBS.halfColor(c as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a color that is half the intensity of the given color.

ArgumentDefaultDescription
c(Mandatory)The given color.
Return Value
A 32-bit integer representing the half intensity color.

CDBaseChartMBS.initDynamicLayer as CDDrawAreaMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Initializes a dynamic layer for drawing text and shapes.

This method clears the existing dynamic layer, or creates a new one if there is no existing dynamic layer. This method returned a DrawArea object that can be used to draw on the dynamic layer. The dynamic layer can later be removed using BaseChart.removeDynamicLayer.

The design of the dynamic layer is for drawing small, rapidly updatable contents for desktop applications. For example, the dynamic layer can be used to implement a cross-hair mouse cursor, with text showing the location of the mouse cursor. To do this, in the mouse move event handler, BaseChart.initDynamicLayer can be used to create or clear the dynamic layer. The returned DrawArea object can then be used to draw the cross hair cursor (as two straight lines) and the text. When the mouse cursor leaves the chart, BaseChart.removeDynamicLayer can be used in the mouse out event handler to remove the cross-hair cursor and the text.

Note that as long as the dynamic layer is not removed with BaseChart.removeDynamicLayer, only the returned DrawArea object should be used to draw things on the dynamic layer. No other objects should be used to draw on the chart.

Returns a DrawArea object that can be used to add text and shapes to the dynamic layer.

CDBaseChartMBS.layout

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Perform auto-scaling of the axis and compute the positions of the various objects in the chart.

BaseChart.layout is automatically called when drawing the chart image (eg. using BaseChart.makeChart, BaseChart.makeChart or BaseChart.makeChart3). There is usually no need to call BaseChart.layout explicitly.

However, if you would like to add custom objects to the chart whose positions depend on the axis scales or position of other objects, you may need to call BaseChart.layout explicit to auto-scaling the axis. An example is to draw a custom label at the maximum value point of a data line.

CDBaseChartMBS.layoutLegend as CDLegendBoxMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Lays out and gets the LegendBox object representing the legend box in the chart.

Once the legend box has been laid out, the width and height is known and can be obtained using Box.getWidth and Box.getHeight. However, you may not perform actions that may affect the legend box sizes, such as changing the fonts or adding more data. You may still move the legend box around by using Box.setPos.

The most common use of this method is to position the legend box based on its actual size.
Return Value
The LegendBox object representing the legend box in the chart.

Some examples using this method:

CDBaseChartMBS.linearGradientColor(startX as Integer, startY as Integer, endX as Integer, endY as Integer, colors() as Integer, periodic as boolean=false) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a multi-point linear gradient color.

In this method, the color points are defined as an array of positions and colors along a reference line segment, in the following format:

position0, color0, position1, color1, .... positionN, colorN
The positions are specified as a number from 0 - 256 (0 - 100 in hex), in which 0 represents the starting point of the reference line segment, and 256 (100 in hex) represents the ending point of the reference line segment.

For example, the array (in hex):

000000, FF0000, 000080, FFFF00, 000100, 00FF00
means the starting point (000000) is red (FF0000), the mid-point (000080 in hex) is yellow (FFFF00), and the ending point (000100 in hex) is green (00FF00).

One common usage of multi-point gradient colors is to define colors that have metallic look and feel. ChartDirector comes from several predefined gradient color arrays as follows.

NameValue (in Hex)
goldGradient 000000, FFE743, 000060, FFFFE0, 0000B0, FFF0B0, 000100, FFE743
silverGradient 000000, C8C8C8, 000060, F8F8F8, 0000B0, E0E0E0, 000100, C8C8C8
redMetalGradient 000000, E09898, 000060, FFF0F0, 0000B0, F0D8D8, 000100, E09898
greenMetalGradient 000000, 98E098, 000060, F0FFF0, 0000B0, D8F0D8, 000100, 98E098
blueMetalGradient 000000, 9898E0, 000060, F0F0FF, 0000B0, D8D8F0, 000100, 9898E0

ArgumentDefaultDescription
startX(Mandatory)The x coordinate of the starting point of the reference gradient line segment.
startY(Mandatory)The y coordinate of the starting point of the reference gradient line segment.
endX(Mandatory)The x coordinate of the ending point of the reference gradient line segment.
endY(Mandatory)The y coordinate of the ending point of the reference gradient line segment.
colorArray(Mandatory)An array defining the positions and colors of the pixels along the reference gradient line segment.
periodicfalseSpecifies whether the gradient will repeat itself periodically. If the gradient does not repeat itself, the points that lie beyond the end points of the gradient line segment will assume the colors of the end points.
Return Value
A 32-bit integer representing the linear gradient color.

See also:

CDBaseChartMBS.linearGradientColor(startX as Integer, startY as Integer, endX as Integer, endY as Integer, startColor as Integer, endColor as Integer, periodic as boolean=false) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a two-point linear gradient color.

ArgumentDefaultDescription
startX(Mandatory)The x coordinate of the starting point of the reference gradient line segment.
startY(Mandatory)The y coordinate of the starting point of the reference gradient line segment.
endX(Mandatory)The x coordinate of the ending point of the reference gradient line segment.
endY(Mandatory)The y coordinate of the ending point of the reference gradient line segment.
startColor(Mandatory)The color at the starting point of the reference gradient line segment.
endColor(Mandatory)The color at the ending point of the reference gradient line segment.
periodicfalseSpecifies whether the gradient will repeat itself periodically. If the gradient does not repeat itself, the points that lie beyond the end points of the gradient line segment will assume the colors of the end points.
Return Value
A 32-bit integer representing the linear gradient color.

See also:

CDBaseChartMBS.makeChart as CDDrawAreaMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Generates the chart in internal format and return a DrawArea object to allow adding custom drawings on top of the chart.

If you want to add custom drawings at the background of the chart, use the BaseChart.getDrawArea method to obtain the DrawArea instead.

After finish adding custom drawings, the resulting chart can then be output using other chart output methods.
Return Value
A DrawArea object that can be used to add custom text and shapes to the chart.

See also:

Some examples using this method:

CDBaseChartMBS.makeChart(format as Integer) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Generates the chart as an image in memory.

This method is most often used to output the chart directly to an HTTP stream.

ChartDirector supports PNG, JPG, GIF, WBMP and BMP formats, denoted by the following predefined constants:

ConstantValueDescription
kPNG0The PNG format.
kGIF1The GIF format.
kJPG2The JPEG format.
kWMP3The WAP bitmap format.
kBMP4The BMP format.
kSVG5Normal SVG.
kSVGZ6Compressed SVG
kPDF7PDF format

For vector output (SVG), please call enableVectorOutput early.

ArgumentDefaultDescription
format(Mandatory)A constant representing the format of the image.
Return Value
A memory block containing the binary image of the chart in the requested format.

See also:

CDBaseChartMBS.makeChart(path as folderitem) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Generates the chart image and save it into a file.

ChartDirector supports PNG, JPG, GIF, WBMP, SVG, PDF and BMP. The format used are selected based on file extension, which should be png, jpg, jpeg, gif, wbmp, wmp, pdf, svg or bmp.

ArgumentDefaultDescription
filename(Mandatory)The name of the file to save the image.
Return Value
A true value indicates no error. A false value indicates the operation is unsuccessful.

See also:

CDBaseChartMBS.patternColor(colorvalues() as Integer, height as Integer, startX as Integer = 0, startY as Integer = 0) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a pattern color using an array of colors as the bitmap pattern.

A pattern color is a dynamic color that changes according to a 2D periodic pattern. When it is used to fill an area, the area will look like being tiled with a wallpaper pattern.
ArgumentDefaultDescription
colorArray(Mandatory)An array of colors representing the colors of the bitmap pixels. The color of the pixel at (x, y) should correspond to index (x + y * width - 1) of the array.
height(Mandatory)The height of the bitmap in pixels. (The width is automatically computed as the size of the color array divided by the height.)
startX0The x coordinate of a reference point to align with the top-left corner the pattern.
startY0The y coordinate of a reference point to align with the top-left corner the pattern.
Return Value
A 32-bit integer representing the pattern color.

See also:

CDBaseChartMBS.patternColor(file as folderitem, startX as Integer = 0, startY as Integer = 0) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a pattern color by loading the pattern from an image file.

A pattern color is a dynamic color that changes according to a 2D periodic pattern. When it is used to fill an area, the area will look like being tiled with a wallpaper pattern.

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
filename(Mandatory)An image file providing the pattern.
startX0The x coordinate of a reference point to align with the top-left corner the pattern.
startY0The y coordinate of a reference point to align with the top-left corner the pattern.
Return Value
A 32-bit integer representing the pattern color.

See also:

CDBaseChartMBS.patternColor(pic as picture, startX as Integer = 0, startY as Integer = 0) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 12.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a pattern color using a picture.

A pattern color is a dynamic color that changes according to a 2D periodic pattern. When it is used to fill an area, the area will look like being tiled with a wallpaper pattern.
ArgumentDefaultDescription
pic(Mandatory)A picture. The color of the pixel at (x, y) should correspond to index (x + y * width - 1) of the array.
startX0The x coordinate of a reference point to align with the top-left corner the pattern.
startY0The y coordinate of a reference point to align with the top-left corner the pattern.
Return Value
A 32-bit integer representing the pattern color.

See also:

CDBaseChartMBS.radialGradientColor(cx as Integer, cy as Integer, rx as Integer, ry as Integer, data() as Integer, periodic as boolean=false) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a multi-point radial gradient color.

In this method, the color points are defined as an array of radial distances and colors, in the following format:

distance0, color0, distance1, color1, .... distanceN, colorN
The distances are specified as a number from 0 - 256 (0 - 100 in hex), in which 0 represents the center of the gradient defining ellipse, and 256 (100 in hex) represents the perimeter of the gradient defining ellipse.

For example, the array (in hex):

000000, FF0000, 000080, FFFF00, 000100, 00FF00
means the center (000000) is red (FF0000), the mid-point (000080 in hex) is yellow (FFFF00), and the perimeter (000100 in hex) is green (00FF00).
ArgumentDefaultDescription
cx(Mandatory)The x coordinate of the center of the radial gradient.
cy(Mandatory)The y coordinate of the center of the radial gradient.
rx(Mandatory)The horizontal radius of the radial gradient defining ellipse.
ry(Mandatory)The vertical radius of the radial gradient defining ellipse.
colorArray(Mandatory)An array defining the radial distances and colors.
periodicfalseSpecifies whether the gradient will repeat itself periodically. If the gradient does not repeat itself, the points that lie outside the gradient defining ellipse will assume the color at the perimeter of the gradient defining ellipse.
Return Value
A 32-bit integer representing the radial gradient color.

See also:

CDBaseChartMBS.radialGradientColor(cx as Integer, cy as Integer, rx as Integer, ry as Integer, startColor as Integer, endColor as Integer, periodic as boolean=false) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a two-point radial gradient color.

ArgumentDefaultDescription
cx(Mandatory)The x coordinate of the center of the radial gradient.
cy(Mandatory)The y coordinate of the center of the radial gradient.
rx(Mandatory)The horizontal radius of the radial gradient defining ellipse.
ry(Mandatory)The vertical radius of the radial gradient defining ellipse.
startColor(Mandatory)The color at the center of the gradient defining ellipse.
endColor(Mandatory)The color at the perimeter of the gradient defining ellipse.
periodicfalseSpecifies whether the gradient will repeat itself periodically. If the gradient does not repeat itself, the points that lie outside the gradient defining ellipse will assume the color at the perimeter of the gradient defining ellipse.
Return Value
A 32-bit integer representing the radial gradient color.

See also:

CDBaseChartMBS.removeDynamicLayer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Removes the dynamic layer if any.

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


The biggest plugin in space...