Platforms to show: All Mac Windows Linux Cross-Platform
CDColorAxisMBS class
Super class: CDAxisMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | ChartDirector | MBS ChartDirector Plugin | 9.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
It is a subclass of Axis.
A color axis is similar to an x or y axis. However, instead of mapping data values to positions, a color axis maps data values to colors. Color axes are used in CDContourLayerMBS and in CDSurfaceChartMBS objects.
Similar to an x or y axis, a color axis is visually represented as a thin bar that can be horizontal or vertical, and has a scale along its length. The scale can be set explicitly or can be determined by auto-scaling.
If you are using the color axis on a surface chart, please note that by default, the color axis scale is synchronized to the z axis. You need to use CDAxisMBS.syncAxis to cancel the synchronization before you can independently set the color axis scale.
In addition to the scale, a color axis is colored with a continuous color gradient or discrete color steps along its length. This maps the values on the axis with colors.
For an x or y axis, the major and minor ticks correspond to major and minor grid lines on the chart. For a color axis, these ticks correspond to major and minor contour lines on the chart.
Like an x or y axis, you can add marks to the color axis using Axis.addMark. They will become mark contour lines on the chart.
The color axis, if visible, acts as a color legend. The axis stem is a thin rectangle 15 pixels in width, configurable with CDAxisMBS.setWidth. A bounding box can be added to surround the color axis using CDColorAxisMBS.setBoundingBox.
A color axis works normally (determines color mapping and contour levels) even if it is not displayed.
Subclass of the CDAxisMBS class.
This is a subclass of an abstract class. You can't create an instance, but you can get one from various plugin functions.
- 19 methods
- method getBoxHeight as Integer
- method getBoxWidth as Integer
- method getColor(z as Double) as Integer
- method getColorScale as Double()
- method setAxisBorder(edgeColor as color, raisedEffect as Integer = 0)
- method setAxisBorder(edgeColor as Integer, raisedEffect as Integer = 0)
- method setAxisPos(x as Integer, y as Integer, alignment as Integer)
- method setBoundingBox(fillColor as color, edgeColor as color, raisedEffect as Integer = 0)
- method setBoundingBox(fillColor as Integer, edgeColor as Integer = &hff000000, raisedEffect as Integer = 0)
- method setBoxMargin(leftMargin as Integer, rightMargin as Integer, topMargin as Integer, bottomMargin as Integer)
- method setBoxMargin(m as Integer)
- method setColorGradient(isContinuous as boolean, Colors() as color, underflowColor as color, overflowColor as color)
- method setColorGradient(isContinuous as boolean, Colors() as color, underflowColor as Integer, overflowColor as Integer = -1)
- method setColorGradient(isContinuous as boolean, Colors() as Integer, underflowColor as Integer = -1, overflowColor as Integer = -1)
- method setColorGradient(isContinuous as boolean=true)
- method setColorScale(colorStops() as Double, underflowColor as Integer = -1, overflowColor as Integer = -1)
- method setCompactAxis(b as boolean=true)
- method setLevels(maxLevels as Integer)
- method setRoundedCorners(r1 as Integer = 10, r2 as Integer = -1, r3 as Integer = -1, r4 as Integer = -1)
Super class CDAxisMBS
- 66 methods
- method addLabel(pos as Double, label as string)
- method addMark(value as Double, lineColor as color, text as string = "", font as string = "", fontsize as Double = 8) as CDMarkMBS
- method addMark(value as Double, lineColor as Integer, text as string = "", font as string = "", fontsize as Double = 8) as CDMarkMBS
- method addZone(startValue as Double, endValue as Double, colorvalue as color)
- method addZone(startValue as Double, endValue as Double, colorvalue as Integer)
- method Constructor Private
- method copyAxis(axis as CDAxisMBS)
- method getAlignment as Integer
- method getAxisImageMap(noOfSegments as Integer, mapWidth as Integer, url as string, queryFormat as string = "", extraAttr as string = "", offsetX as Integer = 0, offsetY as Integer = 0) as string
- method getCoor(value as Double) as Integer
- method getFormattedLabel(v as Double, options as string = "") as string
- method getHTMLImageMap(url as string, queryFormat as string = "", extraAttr as string = "", offsetX as Integer = 0, offsetY as Integer = 0) as string
- method getLabel(i as Double) as string
- method getLabelTable as CDMLTableMBS
- method getMaxValue as Double
- method getMinValue as Double
- method getThickness as Integer
- method getTicks as CDArrayMBS
- method getX as Integer
- method getY as Integer
- method makeLabelTable as CDMLTableMBS
- method setAngle(angle as Double)
- method setAutoScale(topExtension as Double = 0.1, bottomExtension as Double = 0.1, zeroAffinity as Double = 0.8)
- method setColors(axisColor as color, labelColor as color, titleColor as color, tickColor as color)
- method setColors(axisColor as Integer, labelColor as Integer = &hffff0002, titleColor as Integer = -1, tickColor as Integer = -1)
- method setDateScale(formatString as string = "")
- method setDateScale(lowerLimit as Double, upperLimit as Double, labels() as string)
- method setDateScale(lowerLimit as Double, upperLimit as Double, majorTickInc as Double = 0, minorTickInc as Double = 0)
- method setFormatCondition(condition as string, operand as Double = 0)
- method setIndent(indent as boolean)
- method setLabelAlignment(alignment as Integer, minLabelSpace as Integer = 3)
- method setLabelFormat(formatString as string)
- method setLabelGap(d as Integer)
- method setLabelOffset(offset as Double)
- method setLabels(labels() as Double, formatString as string = "") as CDTextBoxMBS
- method setLabels(labels() as string) as CDTextBoxMBS
- method setLabelStep(majorTickStep as Integer, minorTickStep as Integer = 0, majorTickOffset as Integer = 0, minorTickOffset as Integer = -2147483647)
- method setLabelStyle(font as string = "", fontsize as Double = 8, fontcolor as Integer = &hffff0002, fontAngle as Double = 0) as CDTextBoxMBS
- method setLabelStyle(font as string, fontsize as Double, fontcolor as color, fontAngle as Double = 0) as CDTextBoxMBS
- method setLength(length as Integer)
- method setLinearScale(formatString as string = "")
- method setLinearScale(lowerLimit as Double, upperLimit as Double, labels() as string)
- method setLinearScale(lowerLimit as Double, upperLimit as Double, majorTickInc as Double = 0, minorTickInc as Double = 0)
- method setLogScale(formatString as string = "")
- method setLogScale(lowerLimit as Double, upperLimit as Double, labels() as string)
- method setLogScale(lowerLimit as Double, upperLimit as Double, majorTickInc as Double = 0, minorTickInc as Double = 0)
- method setMargin(topMargin as Integer, bottomMargin as Integer = 0)
- method setMinTickInc(value as Double)
- method setMultiFormat(filter as Integer, format as string, labelSpan as Integer = 1, promoteFirst as boolean=true)
- method setMultiFormat(filter1 as Integer, format1 as string, filter2 as Integer, format2 as string, labelSpan as Integer = 1, promoteFirst as boolean=true)
- method setOffset(x as Integer, y as Integer)
- method setReverse(value as boolean=true)
- method setRounding(roundMin as boolean, roundMax as boolean)
- method setTickColor(majorTickColor as color, minorTickColor as color)
- method setTickColor(majorTickColor as Integer, minorTickColor as Integer = -1)
- method setTickDensity(majorTickSpacing as Integer, minorTickSpacing as Integer = -1)
- method setTickLength(majorTickLen as Integer)
- method setTickLength(majorTickLen as Integer, minorTickLen as Integer)
- method setTickOffset(offset as Double)
- method setTickWidth(majorTickWidth as Integer, minorTickWidth as Integer = -1)
- method setTitle(text as string, font as string = "", fontsize as Double = 8, fontcolor as Integer = &hffff0002) as CDTextBoxMBS
- method setTitle(text as string, font as string, fontsize as Double, fontcolor as color) as CDTextBoxMBS
- method setTitlePos(alignment as Integer, titleGap as Integer = 3)
- method setWidth(width as Integer)
- method syncAxis(axis as CDAxisMBS, slope as Double = 1.0, intercept as Double = 0.0)
- method syncScale(axis as CDAxisMBS = nil, slope as double = 1.0, intercept as double = 0.0)
This class has no sub classes.
Some methods using this class:
- CDContourLayerMBS.colorAxis as CDColorAxisMBS
- CDContourLayerMBS.setColorAxis(x as Integer, y as Integer, alignment as Integer, length as Integer, orientation as Integer) as CDColorAxisMBS
- CDDiscreteHeatMapLayerMBS.colorAxis as CDColorAxisMBS
- CDDiscreteHeatMapLayerMBS.setColorAxis(x as integer, y as integer, alignment as integer, length as integer, orientation as integer) as CDColorAxisMBS
- CDThreeDChartMBS.colorAxis as CDColorAxisMBS
- CDThreeDChartMBS.setColorAxis(x as Integer, y as Integer, alignment as Integer, length as Integer, orientation as Integer) as CDColorAxisMBS
Some examples using this class:
- /ChartDirector/contour
- /ChartDirector/High Resolution Chart Examples/contour
- /ChartDirector/High Resolution Chart Examples/surfaceaxis
- /ChartDirector/scattersurface
- /ChartDirector/smoothcontour
- /ChartDirector/surface retina
- /ChartDirector/surfaceaxis with controls
- /ChartDirector/surfacecolor
- /ChartDirector/surfacetexture
- /ChartDirector/threedscatter2
Blog Entries
Xojo Developer Magazine
- 7.5, page 34: Easy Charts and Graphs Part 2, Using the ChartDirector Plugin
- 7.4, page 33: Easy Charts and Graphs, Using the ChartDirector Plugin
Release notes
- Version 21.3
- Fixed underflowColor and overflowColor parameters for setColorScale and setColorGradient methods in CDColorAxisMBS class.
The items on this page are in the following plugins: MBS ChartDirector Plugin.
CDCandleStickLayerMBS - CDContourLayerMBS