Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

Next items

CDBaseChartMBS.addExtraField(numbers() as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Adds an array of numbers/dates to be used as an extra field in various places.
Notes:
This method merely stores the data inside the chart object. The Parameter Substitution and Formatting mechanism will determine how the data are to be used.

A common use for extra fields is to specify extra information (such as a custom serial number for the data points) to be displayed on data labels or on tool tips, or to supply extra query parameters in clickable charts. All these are achieved by specifying the extra field on the data label template or image map templates during parameter substitution.
ArgumentDefaultDescription
numbers(Mandatory)An array of numbers/dates to be stored inside the chart object.

See also:

Feedback, Comments & Corrections

CDBaseChartMBS.addExtraField(paths() as folderitem)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Adds an array of file paths to be used as an extra field in various places.
Notes:
This method merely stores the data inside the chart object. The Parameter Substitution and Formatting mechanism will determine how the data are to be used.

A common use for extra fields is to specify extra information (such as a custom serial number for the data points) to be displayed on data labels or on tool tips, or to supply extra query parameters in clickable charts. All these are achieved by specifying the extra field on the data label template or image map templates during parameter substitution.
ArgumentDefaultDescription
texts(Mandatory)An array of text to be stored inside the chart object.

See also:

Feedback, Comments & Corrections

CDBaseChartMBS.addExtraField(texts() as string)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Adds an array of text to be used as an extra field in various places.
Notes:
This method merely stores the data inside the chart object. The Parameter Substitution and Formatting mechanism will determine how the data are to be used.

A common use for extra fields is to specify extra information (such as a custom serial number for the data points) to be displayed on data labels or on tool tips, or to supply extra query parameters in clickable charts. All these are achieved by specifying the extra field on the data label template or image map templates during parameter substitution.
ArgumentDefaultDescription
texts(Mandatory)An array of text to be stored inside the chart object.

See also:

Feedback, Comments & Corrections

CDBaseChartMBS.addLegend(x as Integer, y as Integer, noOfCols as Integer, font as string = "", fontsize as Double = 10) as CDLegendBoxMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Adds a legend box to the chart with grid layout.
Notes:
In grid layout, the legend box will be divided into a table in which all cells are of of same width. The legend entries will fill the cells from left to right, top to bottom.

The number of columns can be specified using the noOfCols argument. If this argument is set to the special constant AutoGrid (= -2), the number of columns will be automatically determined based on the longest legend entry. If this argument is 0, the legend box will use a flow layout (from left to right and then top to bottom, in which the entries may not be vertically aligned).

In any case, the number of rows in the table is automatically determined so as to have enough cells for all legend entries.
ArgumentDefaultDescription
x(Mandatory)The x coordinate of the reference point of the legend box. By default, the reference point is the top-left corner of the box, but can be configured by using TextBox.setAlignment.
y(Mandatory)The y coordinate of the reference point of the legend box. By default, the reference point is the top-left corner of the box, but can be configured by using TextBox.setAlignment.
noOfCols(Mandatory)The number of columns in the legend box. The special value AutoGrid (= -2) means the number of columns is automatically determined. If this argument is 0, the legend box will use a flow layout (from left to right and then top to bottom, in which the entries may not be vertically aligned).
font""The font name of the font for drawing the legend text. The default is "normal". See Font Specification for details on various font attributes.
fontSize10The font size of the legend text.
Return Value
A LegendBox object representing the legend box. You may use this object to fine-tune the appearance of the legend box.

See font specification here:
http://www.monkeybreadsoftware.net/faq-chartdirectorfontspecification.shtml

See also:

Feedback, Comments & Corrections

CDBaseChartMBS.addLegend(x as Integer, y as Integer, vertical as boolean=true, font as string = "", fontsize as Double = 10) as CDLegendBoxMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Adds a legend box to the chart.
Notes:
The entries in the legend box will flow from top to bottom (one line per entry), or from left to right and then top to bottom (like flowing text), depending on the vertical argument. For grid layout, use BaseChart.addLegend2.
ArgumentDefaultDescription
x(Mandatory)The x coordinate of the reference point of the legend box. By default, the reference point is the top-left corner of the box, but can be configured by using TextBox.setAlignment.
y(Mandatory)The y coordinate of the reference point of the legend box. By default, the reference point is the top-left corner of the box, but can be configured by using TextBox.setAlignment.
verticaltrueA true value means the legend keys are laid out vertically (one line per entry). A false value means the legend keys are laid out horizontal and flow like text (from left to right, top to bottom).
font""The font name of the font for drawing the legend text. The default is "normal". See Font Specification for details on various font attributes.
fontSize10The font size of the legend text.
Return Value
A LegendBox object representing the legend box. You may use this object to fine-tune the appearance of the legend box.

See font specification here:
http://www.monkeybreadsoftware.net/faq-chartdirectorfontspecification.shtml

See also:

Feedback, Comments & Corrections

CDBaseChartMBS.addLine(x1 as Integer, y1 as Integer, x2 as Integer, y2 as Integer, colorvalue as color, lineWidth as Integer = 1) as CDLineMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 11.1 Yes Yes Yes Yes No
Function: Same as the other addLine method, but uses color instead of integer data type for passing color values.

See also:

Feedback, Comments & Corrections

CDBaseChartMBS.addLine(x1 as Integer, y1 as Integer, x2 as Integer, y2 as Integer, colorvalue as Integer = &hffff0001, lineWidth as Integer = 1) as CDLineMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Adds a line to the chart.
Notes:
ArgumentDefaultDescription
x1(Mandatory)The x coordinate of the first endpoint of the line.
y1(Mandatory)The y coordinate of the first endpoint of the line.
x2(Mandatory)The x coordinate of the second endpoint of the line.
y2(Mandatory)The y coordinate of the second endpoint of the line.
colorLineColorThe color of the line.
lineWidth1The width of the line.
Return Value
A Line object representing the line added. You may use this object to fine- tune the appearance of the line.

See also:

Feedback, Comments & Corrections

CDBaseChartMBS.addTable(x as Integer, y as Integer, alignment as Integer, col as Integer, row as Integer) as CDMLTableMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 9.2 Yes Yes Yes Yes No
Function: Adds a CDML table to the chart.
Notes:
Arguments:
ArgumentDefaultDescription
x(Mandatory)The x-coordinate of the reference point used to position the table.
y(Mandatory)The y-coordinate of the reference point used to position the table.
alignment(Mandatory)The alignment of the table with respect to the reference point. For example, a value of kTopLeft means the reference point is the top- left corner of the table. See Alignment Specification for supported alignment types..
col(Mandatory)The number of columns in the table.
row(Mandatory)The number of rows in the table.

Returns a CDMLTableMBS object representing the CDML table added.

Feedback, Comments & Corrections

CDBaseChartMBS.addText(x as Integer, y as Integer, text as string, font as string = "", fontsize as Double = 8, fontcolor as Integer = &hffff0002, alignment as Integer = 7, angle as Double = 0, vertical as boolean=false) as CDTextBoxMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Adds a text box to the chart.
Notes:
By default, only the text is visible, the box is transparent. This method returns a TextBox object that can be used to change the appearance of the text box.
ArgumentDefaultDescription
x(Mandatory)The x coordinate of the left of the text box.
y(Mandatory)The y coordinate of the top of the text box.
text(Mandatory)The text to shown in the text box. See ChartDirector Mark Up Language on how to embed special tags in the text for sophisticated formatting.
font""The font used to draw the text. See Font Specification for details on various font attributes.
fontSize8The font size used to draw the text.
fontColorTextColorThe color used to draw the text.
alignmentTopLeftThe alignment of the text within the text box. See Alignment Specification for supported alignment types.
angle0The rotation angle of the text within the text box.
verticalfalseIndicate whether the text should be laid out vertically (from top to bottom) or horizontally (from left to right).
Return Value
A TextBox object representing the text box. This may be used to fine-tune the appearance of the text box.

See font specification here:
http://www.monkeybreadsoftware.net/faq-chartdirectorfontspecification.shtml

See also:

Feedback, Comments & Corrections

CDBaseChartMBS.addText(x as Integer, y as Integer, text as string, font as string, fontsize as Double, fontcolor as color, alignment as Integer = 7, angle as Double = 0, vertical as boolean=false) as CDTextBoxMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 11.1 Yes Yes Yes Yes No
Function: Same as the other addText method, but uses color instead of integer data type for passing color values.

See also:

Feedback, Comments & Corrections

CDBaseChartMBS.addTitle(alignment as Integer, text as string, font as string = "", fontsize as Double = 12, fontColor as Integer = &hffff0002, bgColor as Integer = &hff000000, edgeColor as Integer = &hff000000) as CDTextBoxMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Adds a title to the chart.
Notes:
ArgumentDefaultDescription
alignment(Mandatory)The position on the title on the chart. See Alignment Specification for supported alignment types.
text(Mandatory)The text for the title. See ChartDirector Mark Up Language on how to embed special tags in the text for sophisticated formatting.
font""The font used to draw the title text. The default is "bold". See Font Specification for details on various font attributes.
fontSize12The font size in points for the title text.
fontColorTextColorThe color of the title text.
bgColorTransparentThe background color of the title box.
edgeColorTransparentThe border color of the title box.
Return Value
A TextBox object representing the title box. This may be used to fine-tune the appearance of the title box.

See font specification here:
http://www.monkeybreadsoftware.net/faq-chartdirectorfontspecification.shtml

See also:

Feedback, Comments & Corrections

CDBaseChartMBS.addTitle(text as string, font as string = "", fontsize as Double = 12, fontColor as Integer = &hffff0002, bgColor as Integer = &hff000000, edgeColor as Integer = &hff000000) as CDTextBoxMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Adds a title at the top center of the chart.
Notes:
The title is contained within a box, of which the width is the same as the width of the chart, and the height is automatically adjusted to fit the text. The box is initially invisible, but can be made visible by setting the bgColor and edgeColor.
ArgumentDefaultDescription
text(Mandatory)The text for the title. See ChartDirector Mark Up Language on how to embed special tags in the text for sophisticated formatting.
font""The font used to draw the title text. The default is "bold". See Font Specification for details on various font attributes.
fontSize12The font size in points for the title text.
fontColorTextColorThe color of the title text.
bgColorTransparentThe background color of the title box.
edgeColorTransparentThe border color of the title box.
Return Value
A TextBox object representing the title box. This may be used to fine-tune the appearance of the title box.

See font specification here:
http://www.monkeybreadsoftware.net/faq-chartdirectorfontspecification.shtml

See also:

Feedback, Comments & Corrections

CDBaseChartMBS.adjustBrightness(ColorValue as color, brightness as Double) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 11.1 Yes Yes Yes Yes No
Function: Same as the other adjustBrightness method, but uses color instead of integer data type for passing color values.

See also:

Feedback, Comments & Corrections

CDBaseChartMBS.adjustBrightness(ColorValue as Integer, brightness as Double) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 9.2 Yes Yes Yes Yes No
Function: Creates a color that is a darkened or brightened version of the given color.
Notes:
A brightness less than 1 means the color is darkened, while a brightness greater than 1 means the color is brightened. For example, a brightness of 0.5 means the color is half as bright as the original color. If the original color is red, the color will become dark red. Conversely, a brightness of 2 means the color is twice as bright as the original color. If the original color is red, the color will become light red.

Arguments:
ArgumentDefaultDescription
c(Mandatory)The given color.
brightness(Mandatory)A non-negative number represent the factor to darken or brighten the color.

Return Value
A 32-bit integer representing the darkened or brightened color.

See also:

Feedback, Comments & Corrections

CDBaseChartMBS.Constructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 15.2 Yes Yes Yes Yes No
Function: The private constructor.

Feedback, Comments & Corrections

CDBaseChartMBS.dashLineColor(colorvalue as color, patternCode as Integer = &h0505) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 11.1 Yes Yes Yes Yes No
Function: Same as the other dashLineColor method, but uses color instead of integer data type for passing color values.

See also:

Feedback, Comments & Corrections

CDBaseChartMBS.dashLineColor(colorvalue as Integer, patternCode as Integer = &h0505) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: A constant equals to 0505 (in hex) to represent a dash line pattern for use in dash colors.
Notes: See Color Specification on how colors are represented in ChartDirector.

See also:

Feedback, Comments & Corrections

CDBaseChartMBS.Destructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 9.2 Yes Yes Yes Yes No
Function: The destructor for the base chart.

Feedback, Comments & Corrections

CDBaseChartMBS.enableVectorOutput
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 9.2 Yes Yes Yes Yes No
Function: Enables true vector graphics output.
Notes:
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.)

Feedback, Comments & Corrections

CDBaseChartMBS.formatValue(value as Double, formatstring as string) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Formats a number/date using the ChartDirector formatting syntax as is in Parameter Substitution and Formatting.
Notes:
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.

Feedback, Comments & Corrections

CDBaseChartMBS.getAbsOffsetX as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 12.3 Yes Yes Yes Yes No
Function: Gets the x offset of the chart relative to the outermost MultiChart container.
Notes: Returns an integer representing the x offset in pixels relative to the outermost MultiChart container, or 0 if the chart is not within a MultiChart container.

Feedback, Comments & Corrections

CDBaseChartMBS.getAbsOffsetY as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 12.3 Yes Yes Yes Yes No
Function: Gets the y offset of the chart relative to the outermost MultiChart container.
Notes: Returns an integer representing the y offset in pixels relative to the outermost MultiChart container, or 0 if the chart is not within a MultiChart container.

Feedback, Comments & Corrections

CDBaseChartMBS.getChartMetrics as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Gets the chart metrics for passing to CChartViewer to support view ports.
Notes:
The format of the chart metrics is not published.
Return Value
A text string representing the chart metrics.

Feedback, Comments & Corrections

CDBaseChartMBS.getColor(index as Integer) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Gets the color at the specified position of the palette.
Notes:
See Color Specification on how colors are represented in ChartDirector.
ArgumentDefaultDescription
paletteEntry(Mandatory)An index to the palette.
Return Value
The requested color.

Feedback, Comments & Corrections

CDBaseChartMBS.getDrawArea as CDDrawAreaMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Retrieves the internal DrawArea object that is used to draw the chart.
Notes:
The most common reason of accessing the internal DrawArea object is to add custom drawings (lines, texts, shapes, etc) to the chart.

If the custom drawings are drawn before drawing the chart image (eg. using BaseChart.makeChart, BaseChart.makeChart or BaseChart.makeChart3), the custom drawings will be at the background of the chart.
Return Value
A DrawArea object that can be used to add custom text and shapes to the chart.

Feedback, Comments & Corrections

CDBaseChartMBS.getHeight as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 9.2 Yes Yes Yes Yes No
Function: Gets the height of the chart.

Feedback, Comments & Corrections

CDBaseChartMBS.getHTMLImageMap(url as string, queryFormat as string = "", extraAttr as string = "", offsetX as Integer = 0, offsetY as Integer = 0) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Generates an HTML image map for the chart.
Notes:
This method generates an image map to represent all data points on the chart. It does not include legend box, title box or custom text box. Please use LegendBox.getHTMLImageMap or Box.getImageCoor to produce image maps for these objects.

This method should be called only after creating the chart image (eg. using BaseChart.makeChart, BaseChart.makeChart or BaseChart.makeChart3). The image map cannot be determined without creating the chart image first.

This method accepts a URL as its argument. When generating an image map, it appends query parameters to the URL to indicate which data point the user has clicked.

The following is an example image map generated for a bar chart with 3 bars.

<area shape="rect" coords="34,219,63,139" href="myurl.cpp?x=0&xLabel=Mon&dataSet=0&dataSetName=Revenue&value=100">
<area shape="rect" coords="74,219,103,119" href="myurl.cpp?x=1&xLabel=Tue&dataSet=0&dataSetName=Revenue&value=125">
<area shape="rect" coords="114,219,143,22" href="myurl.cpp?x=2&xLabel=Wed&dataSet=0&dataSetName=Revenue&value=245.78">

The image map consists of multiple <area> tags, one for each bar in the chart. In the "href" attributes, query parameters are appended to the URL to provide information on the bar clicked.

The image map produces by ChartDirector does not include the <map> and </map> tag. This is intentional so that you can add additional custom <area> tags to the image map, or append multiple image maps together.

The type of query parameters to append to the URL depends on the chart type and layer type. The default query parameters are as follows.

Chart/Layer TypeDefault Query Format
Pie chartsector={sector}&label={label}&value={value}&percent={percent}
Bar, Line, Spline, Step Line, Area and Scatter layersx={x}&xLabel={xLabel}&dataSet={dataSet}&dataSetName={dataSetName}&value={value}
Percentage Bar and Percentage Area layersx={x}&xLabel={xLabel}&dataSet={dataSet}&dataSetName={dataSetName}&value={value}&percent={percent}
HLOC and CandleStick layersx={x}&xLabel={xLabel}&high={high}&low={low}&open={open}&close={close}
Box-Whisker layerx={x}&xLabel={xLabel}&top={top}&bottom={bottom}&max={max}&min={min}&med={med}
Trend layerdataSetName={dataSetName}
Vector layer and Polar Vector layerx={x}&xLabel={xLabel}&dataSetName={dataSetName}&value={value}&dir={dir}&len={len}
Polar Line, Area, Spline Line and Spline Area layers"x={x}&label={label}&name={name}&value={value}"

The texts in curly brackets (e.g. {sector}, {dataSet}, etc.) will be replaced by the actual values when generating the image map. For example, {sector} will be replaced by the sector number of the sector.

ChartDirector allows developers to modify the query parameters by using the queryFormat argument. For example, if "x={x}&v={value}" is used as the queryFormat for a XYChart, only the x position and the value of the data point will be included in query parameters.

Please refer to Parameter Substitution and Formatting on all available parameters and their meanings.

In addition to customizing the query parameters, ChartDirector supports additional HTML attributes in the <area> tags by using the extraAttr argument.

For example, the following extraAttr will add an "title" HTML attribute to every <area> tag. The attribute which will contain the x-axis label and the value of the data point. The "title" attribute will be displayed as "tool tip" when the mouse moves over the image map.

title='{xlabel}:{value}'
Another common usage of the extraAttr argument is to add "onmouseover" and "onmouseout" HTML attributes to handle user interaction using Javascript on the browser.
ArgumentDefaultDescription
url(Mandatory)The URL to be used in the "href" attribute of the image map. Parameter Substitution and Formatting is supported. Use an empty string if no href attribute is needed.
queryFormat""A text string representing the template of the query parameters to be appended to the URL. Parameter Substitution and Formatting is supported.

The special keyword "{default}" represents the default query parameters. This is useful for specifying appending to the default.

Note that an empty string means to use the default query query parameters. To specify no query parameter, use a space character.
extraAttr""A text string to specify additional attributes to add to the <area> tag. Parameter Substitution and Formatting is supported.
offsetX0An offset to be added to all x coordinates in the image map. This is useful if the current image will be shifted and inserted into another image. In this case, the image map will need to be shifted by the same offset.
offsetY0An offset to be added to all y coordinates in the image map. See offsetX above for description.
Return Value
A text string containing the image map generated.

Feedback, Comments & Corrections

Next items

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





Links
MBS Xojo Chart Plugins