colorLegend.format

Sets the format for data values displayed in the color legend.

Type

StyleConstant.DATE_FORMAT

date display

StyleConstant.DECIMAL_FORMAT

number display

StyleConstant.MESSAGE_FORMAT

text display

StyleConstant.PERCENT_FORMAT

fraction display

StyleConstant.CURRENCY_FORMAT

locale-adapting currency display

For the Date, Decimal, and Message formats, use the formatSpec property to assign a format specification using the appropriate masks: [formatType, formatSpec]. See the examples below.

Examples

Number Format
Chart1.colorLegend.format = [Chart.DECIMAL_FORMAT,"$#,##0.00"]

chart color legend with number format applied to labels

Text Format
Chart1.colorLegend.format = [Chart.MESSAGE_FORMAT,"{0} Inc."];

chart color legend with text format applied to labels

Either syntax below can be used in component script:

colorLegend.format          // unqualified
Chart1.colorLegend.format   // qualified

For onInit/onRefresh scripts, and for component and property scripts on other components, the second (qualified) form is required.