Class MetricSettings
- All Implemented Interfaces:
HasHandlers
additional value axes
of a FacetChart
. These properties behave identically to the same-named properties of
FacetChart. Two exceptions are the properties gradationLineProperties
and gradationZeroLineProperties
because
they are used to draw tick marks along an extra value axis instead of lines through the chart rectangle. Also the
default behavior of the dataColors
property is
different, in that the default is to use unused colors from, and in the order of, the main data colors array
.
The extra value axes that are
not positioned directly adjacent to the chart
rect.
of the FacetChart may additionally have an axis line to connect the gradation tick marks. Whether to draw this
line is controlled by the showAxisLine
property, and the properties of the line are specified using axisLineProperties
. The default is to draw the
axis lines whenever the chart rect. is drawn and to draw the line using the same properties as the lines of the chart
rect. (for example, lineColor and lineWidth).
The extra value axis charts may be single- or multi-facet
charts. If the underlying data
is multi-facet then the extra value axes may use the facet
whose values are labelled on the data axis or the facet used to create the legend (the first and second facets,
respectively). Both types of charts vary the first facet to get a data series to plot. Multi-facet charts also vary
the second facet, but single-facet charts keep the second facet fixed at a constant FacetValue
.
The exact facet value to use for the second facet is specified using
the fixedFacetValue
property.
-
Field Summary
Fields inherited from class com.smartgwt.client.core.DataClass
factoryCreated, factoryProperties
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
changeAutoChildDefaults
(String autoChildName, Canvas defaults) Changes the defaults for Canvas AutoChildren namedautoChildName
.static void
changeAutoChildDefaults
(String autoChildName, FormItem defaults) Changes the defaults for FormItem AutoChildren namedautoChildName
.Properties for the axis line drawn if this extra value axis is not positioned directly adjacent to the chart rect.Same asFacetChart.axisStartValue
but affects only one metric.SeeChartType
for a list of known types - Column, Bar, Line, Pie, Doughnut, Area, Radar, and Histogram charts are supported.getDataColor
(int index) getDataColor
(int index, Double facetValueId, String purpose) getDataColor
(int index, Integer facetValueId, String purpose) getDataColor
(int index, String facetValueId, String purpose) Get a color from thedataColors
Array.getDataColor
(int index, Date facetValueId, String purpose) String[]
An array of colors to use for a series of visual elements representing data (eg columns, bars, pie slices), any of which may be adjacent to any other.Properties for lines that show data (as opposed to gradations or borders around the data area).Properties for lines that outline a data shape (in filled charts such as area or radar charts).Common properties to apply for all data points (seeshowDataPoints
).int
Size in pixels for data points drawn for line, area, radar and other chart types.Properties for data shapes (filled areas in area or radar charts).int
TheFacetChart.decimalPrecision
used to render the numeric labels of this metric axis.Whether shapes are filled, for example, whether a multi-series line chart appears as a stack of filled regions as opposed to just multiple lines.For asingle-facet
chart of an extra value axis, this property provides a constant facet value for the second facet.Properties for gradation labelsProperties for gradation linesfloat[]
Return an array of the gradation values used in the current chart.Properties for the gradation line drawn for zero (slightly thicker by default).Forsingle-facet
charts embedded in a multi-facet main chart, thelegendLabel
defines the text of the legend label for this chart.int
WhenuseLogGradations
, base value for logarithmic gradation lines.float[]
WhenuseLogGradations
is set, gradation lines to show in between powers, expressed as a series of integer or float values between 1 andlogBase
.Whether to use logarithmic scaling for values.When this property is set to the metric of another MetricSettings object, the extra value axis and chart corresponding to these settings will use the same scale for the gradations as the extra value axis and chart of the other MetricSettings object.Same asFacetChart.minDataSpreadPercent
but affects only one metric.Whether this extra value axis plots values while varying the facet values of just the first facet (single-facet) or both first and second facets (multi-facet).static MetricSettings
getOrCreateRef
(JavaScriptObject jsObj) For multi-facet charts, render data values as a proportion of the sum of all data values that have the same label.Default title for the value axis label when the chart is inproportional rendering mode
.Properties for shadows.Whether to show the extra value axis.Whether to show an axis line for this extra value axis if it is not placed directly adjacent to the chart rect.For Line, Area, Radar, Scatter or Bubble charts, whether to show data points for each individual data value.Deprecated.Whether to automatically show shadows for various charts.Whether to show thevalueTitle
(or, in the case ofproportional rendering mode
,proportionalAxisLabel
) as a label on this extra value axis.Deprecated.in favor ofFacetChart.showDataValuesMode
, a compound setting that supports showing data-values in the chart and in hovers in various combinations.If theChartType
is "Column" then the metric settings may include a setting forFacetChart.stacked
.Whether to use classic logarithmic gradations, where each order of magnitude is shown as a gradation as well as a few intervening lines.Properties for labels of value axis.Properties for a "value line" - a line shows where a particular discrete value is placed, eg, vertical lines connecting points of a line chart to the X axis, or radial lines in a Radar chart.A label for the data values, such as "Sales in Thousands", typically used as the label for the value axis.Same asFacetChart.xAxisEndValue
but affects only one metric.float
getXCoord
(float value) Deprecated.getXCoordAsDouble
(double value) Returns the X coordinate where the passed data value either was or would be drawn.float
getYCoord
(float value) Deprecated.double
getYCoordAsDouble
(double value) Returns the Y coordinate where the passed data value either was or would be drawn.setAxisLineProperties
(DrawLine axisLineProperties) Properties for the axis line drawn if this extra value axis is not positioned directly adjacent to the chart rect.setAxisStartValue
(Double axisStartValue) Same asFacetChart.axisStartValue
but affects only one metric.void
setAxisValueFormatter
(ValueFormatter formatter) Formatter to apply to values displayed in the gradation labels.setChartType
(ChartType chartType) SeeChartType
for a list of known types - Column, Bar, Line, Pie, Doughnut, Area, Radar, and Histogram charts are supported.void
setDataColorMapper
(ColorMapper colorMapper) Sets a customizer to redefine what colors are used when rendering the chart data.setDataColors
(String... dataColors) An array of colors to use for a series of visual elements representing data (eg columns, bars, pie slices), any of which may be adjacent to any other.void
setDataGradientMapper
(GradientMapper gradientMapper) Sets a customizer to redefine what gradients are used when rendering the chart data.void
setDataLineColorMapper
(ColorMapper colorMapper) Sets a customizer to redefine what colors are used when rendering lines for the chart data.setDataLineProperties
(DrawLine dataLineProperties) Properties for lines that show data (as opposed to gradations or borders around the data area).setDataOutlineProperties
(DrawItem dataOutlineProperties) Properties for lines that outline a data shape (in filled charts such as area or radar charts).setDataPointProperties
(DrawItem dataPointProperties) Common properties to apply for all data points (seeshowDataPoints
).setDataPointSize
(int dataPointSize) Size in pixels for data points drawn for line, area, radar and other chart types.setDataShapeProperties
(DrawPath dataShapeProperties) Properties for data shapes (filled areas in area or radar charts).void
setDataValueFormatter
(ValueFormatter formatter) Formatter to apply to values displayed in the hover labels and other value labelssetDecimalPrecision
(int decimalPrecision) TheFacetChart.decimalPrecision
used to render the numeric labels of this metric axis.Whether shapes are filled, for example, whether a multi-series line chart appears as a stack of filled regions as opposed to just multiple lines.setFixedFacetValue
(Integer fixedFacetValue) For asingle-facet
chart of an extra value axis, this property provides a constant facet value for the second facet.setFixedFacetValue
(String fixedFacetValue) For asingle-facet
chart of an extra value axis, this property provides a constant facet value for the second facet.setGradationLabelProperties
(DrawLabel gradationLabelProperties) Properties for gradation labelssetGradationLineProperties
(DrawLine gradationLineProperties) Properties for gradation linessetGradationZeroLineProperties
(DrawLine gradationZeroLineProperties) Properties for the gradation line drawn for zero (slightly thicker by default).setLegendLabel
(String legendLabel) Forsingle-facet
charts embedded in a multi-facet main chart, thelegendLabel
defines the text of the legend label for this chart.setLogBase
(int logBase) WhenuseLogGradations
, base value for logarithmic gradation lines.setLogGradations
(float... logGradations) WhenuseLogGradations
is set, gradation lines to show in between powers, expressed as a series of integer or float values between 1 andlogBase
.setLogScale
(Boolean logScale) Whether to use logarithmic scaling for values.setMatchGradations
(String matchGradations) When this property is set to the metric of another MetricSettings object, the extra value axis and chart corresponding to these settings will use the same scale for the gradations as the extra value axis and chart of the other MetricSettings object.setMinDataSpreadPercent
(Integer minDataSpreadPercent) Same asFacetChart.minDataSpreadPercent
but affects only one metric.setMultiFacet
(Boolean multiFacet) Whether this extra value axis plots values while varying the facet values of just the first facet (single-facet) or both first and second facets (multi-facet).void
Apply a handler to fire whenshowDataPoints
is true, and the user clicks on a point.void
setPointHoverCustomizer
(ChartPointHoverCustomizer hoverCustomizer) Display custom HTML whenshowDataPoints
is true and the mouse hovers over a point.setProportional
(Boolean proportional) For multi-facet charts, render data values as a proportion of the sum of all data values that have the same label.setProportionalAxisLabel
(String proportionalAxisLabel) Default title for the value axis label when the chart is inproportional rendering mode
.setShadowProperties
(DrawOval shadowProperties) Properties for shadows.setShowAxis
(Boolean showAxis) Whether to show the extra value axis.setShowAxisLine
(Boolean showAxisLine) Whether to show an axis line for this extra value axis if it is not placed directly adjacent to the chart rect.setShowDataPoints
(Boolean showDataPoints) For Line, Area, Radar, Scatter or Bubble charts, whether to show data points for each individual data value.setShowDataValues
(Boolean showDataValues) Deprecated.in favor ofFacetChart.showDataValuesMode
, a compound setting that supports showing data-values in the chart and in hovers in various combinations.setShowShadows
(Boolean showShadows) Whether to automatically show shadows for various charts.setShowValueAxisLabel
(Boolean showValueAxisLabel) Whether to show thevalueTitle
(or, in the case ofproportional rendering mode
,proportionalAxisLabel
) as a label on this extra value axis.setShowValueOnHover
(Boolean showValueOnHover) Deprecated.in favor ofFacetChart.showDataValuesMode
, a compound setting that supports showing data-values in the chart and in hovers in various combinations.setStacked
(Boolean stacked) If theChartType
is "Column" then the metric settings may include a setting forFacetChart.stacked
.setUseLogGradations
(Boolean useLogGradations) Whether to use classic logarithmic gradations, where each order of magnitude is shown as a gradation as well as a few intervening lines.setValueAxisLabelProperties
(DrawLabel valueAxisLabelProperties) Properties for labels of value axis.setValueLineProperties
(DrawLine valueLineProperties) Properties for a "value line" - a line shows where a particular discrete value is placed, eg, vertical lines connecting points of a line chart to the X axis, or radial lines in a Radar chart.setValueTitle
(String valueTitle) A label for the data values, such as "Sales in Thousands", typically used as the label for the value axis.setXAxisEndValue
(Double xAxisEndValue) Same asFacetChart.xAxisEndValue
but affects only one metric.Methods inherited from class com.smartgwt.client.core.DataClass
applyFactoryProperties, doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, isFactoryCreated, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject, setFactoryCreated
-
Constructor Details
-
MetricSettings
public MetricSettings() -
MetricSettings
-
-
Method Details
-
getOrCreateRef
-
changeAutoChildDefaults
Changes the defaults for Canvas AutoChildren namedautoChildName
.- Parameters:
autoChildName
- name of an AutoChild to customize the defaults for.defaults
- Canvas defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, seeSGWTProperties
.- See Also:
-
changeAutoChildDefaults
Changes the defaults for FormItem AutoChildren namedautoChildName
.- Parameters:
autoChildName
- name of an AutoChild to customize the defaults for.defaults
- FormItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, seeSGWTProperties
.- See Also:
-
setAxisLineProperties
Properties for the axis line drawn if this extra value axis is not positioned directly adjacent to the chart rect. The default is to match thelineCap
,lineColor
,lineOpacity
,linePattern
, andlineWidth
of the FacetChart'schart rect.
for each axis line.- Parameters:
axisLineProperties
- New axisLineProperties value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls- See Also:
-
getAxisLineProperties
Properties for the axis line drawn if this extra value axis is not positioned directly adjacent to the chart rect. The default is to match thelineCap
,lineColor
,lineOpacity
,linePattern
, andlineWidth
of the FacetChart'schart rect.
for each axis line.- Returns:
- Current axisLineProperties value. Default value is null
-
setAxisStartValue
Same asFacetChart.axisStartValue
but affects only one metric.- Parameters:
axisStartValue
- New axisStartValue value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls
-
getAxisStartValue
Same asFacetChart.axisStartValue
but affects only one metric.- Returns:
- Current axisStartValue value. Default value is null
-
setChartType
SeeChartType
for a list of known types - Column, Bar, Line, Pie, Doughnut, Area, Radar, and Histogram charts are supported.
If this method is called after the component has been drawn/initialized: Method to change the currentchartType
. Will redraw the chart if drawn. Will use default settings for the new chart type forstacked
andfilled
if those values are null.Note that for
multi-axis
charts this method changes thechartType
for the main value axis only.- Parameters:
chartType
- new chart type. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls
-
getChartType
SeeChartType
for a list of known types - Column, Bar, Line, Pie, Doughnut, Area, Radar, and Histogram charts are supported.- Returns:
- Current chartType value. Default value is null
-
setDataColors
An array of colors to use for a series of visual elements representing data (eg columns, bars, pie slices), any of which may be adjacent to any other.Colors must be in the format of a leading hash (#) plus 6 hexadecimal digits, for example, "#FFFFFF" is white, "#FF0000" is pure red.
If this method is called after the component has been drawn/initialized: Setter fordataColors
.- Parameters:
dataColors
- New set of data colors. Default value is see below- Returns:
MetricSettings
instance, for chaining setter calls- See Also:
-
getDataColors
An array of colors to use for a series of visual elements representing data (eg columns, bars, pie slices), any of which may be adjacent to any other.Colors must be in the format of a leading hash (#) plus 6 hexadecimal digits, for example, "#FFFFFF" is white, "#FF0000" is pure red.
- Returns:
- Current dataColors value. Default value is see below
- See Also:
-
setDataLineProperties
Properties for lines that show data (as opposed to gradations or borders around the data area).- Parameters:
dataLineProperties
- New dataLineProperties value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls- See Also:
-
getDataLineProperties
Properties for lines that show data (as opposed to gradations or borders around the data area).- Returns:
- Current dataLineProperties value. Default value is null
-
setDataOutlineProperties
Properties for lines that outline a data shape (in filled charts such as area or radar charts).- Parameters:
dataOutlineProperties
- New dataOutlineProperties value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls- See Also:
-
getDataOutlineProperties
Properties for lines that outline a data shape (in filled charts such as area or radar charts).- Returns:
- Current dataOutlineProperties value. Default value is null
-
setDataPointProperties
Common properties to apply for all data points (seeshowDataPoints
).- Parameters:
dataPointProperties
- New dataPointProperties value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls- See Also:
-
getDataPointProperties
Common properties to apply for all data points (seeshowDataPoints
).- Returns:
- Current dataPointProperties value. Default value is null
-
setDataPointSize
Size in pixels for data points drawn for line, area, radar and other chart types.- Parameters:
dataPointSize
- New dataPointSize value. Default value is 6- Returns:
MetricSettings
instance, for chaining setter calls
-
getDataPointSize
public int getDataPointSize()Size in pixels for data points drawn for line, area, radar and other chart types.- Returns:
- Current dataPointSize value. Default value is 6
-
setDataShapeProperties
Properties for data shapes (filled areas in area or radar charts).- Parameters:
dataShapeProperties
- New dataShapeProperties value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls- See Also:
-
getDataShapeProperties
Properties for data shapes (filled areas in area or radar charts).- Returns:
- Current dataShapeProperties value. Default value is null
-
setDecimalPrecision
TheFacetChart.decimalPrecision
used to render the numeric labels of this metric axis.- Parameters:
decimalPrecision
- New decimalPrecision value. Default value is 2- Returns:
MetricSettings
instance, for chaining setter calls
-
getDecimalPrecision
public int getDecimalPrecision()TheFacetChart.decimalPrecision
used to render the numeric labels of this metric axis.- Returns:
- Current decimalPrecision value. Default value is 2
-
setFilled
Whether shapes are filled, for example, whether a multi-series line chart appears as a stack of filled regions as opposed to just multiple lines.If unset, fills will be automatically used when there are multiple facets and stacking is active (so Line and Radar charts will show stacked regions).
You can explicitly set filled:false to create multi-facet Line or Radar charts where translucent regions overlap, or filled:true to fill in a single-facet Line or Radar chart.
If this method is called after the component has been drawn/initialized: Method to changefilled
. Use null to apply a default value for the currentchartType
.- Parameters:
filled
- new value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls
-
getFilled
Whether shapes are filled, for example, whether a multi-series line chart appears as a stack of filled regions as opposed to just multiple lines.If unset, fills will be automatically used when there are multiple facets and stacking is active (so Line and Radar charts will show stacked regions).
You can explicitly set filled:false to create multi-facet Line or Radar charts where translucent regions overlap, or filled:true to fill in a single-facet Line or Radar chart.
- Returns:
- Current filled value. Default value is null
-
setFixedFacetValue
For asingle-facet
chart of an extra value axis, this property provides a constant facet value for the second facet. By varying the value of the other facet in multi-facet data, the chart obtains the series of values to plot. The default facet value is the first facet value of the second facet.- Parameters:
fixedFacetValue
- New fixedFacetValue value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls
-
getFixedFacetValue
For asingle-facet
chart of an extra value axis, this property provides a constant facet value for the second facet. By varying the value of the other facet in multi-facet data, the chart obtains the series of values to plot. The default facet value is the first facet value of the second facet.- Returns:
- Current fixedFacetValue value. Default value is null
-
setFixedFacetValue
For asingle-facet
chart of an extra value axis, this property provides a constant facet value for the second facet. By varying the value of the other facet in multi-facet data, the chart obtains the series of values to plot. The default facet value is the first facet value of the second facet.- Parameters:
fixedFacetValue
- New fixedFacetValue value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls
-
setGradationLabelProperties
Properties for gradation labels- Parameters:
gradationLabelProperties
- New gradationLabelProperties value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls- See Also:
-
getGradationLabelProperties
Properties for gradation labels- Returns:
- Current gradationLabelProperties value. Default value is null
-
setGradationLineProperties
Properties for gradation lines- Parameters:
gradationLineProperties
- New gradationLineProperties value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls- See Also:
-
getGradationLineProperties
Properties for gradation lines- Returns:
- Current gradationLineProperties value. Default value is null
-
setGradationZeroLineProperties
Properties for the gradation line drawn for zero (slightly thicker by default).- Parameters:
gradationZeroLineProperties
- New gradationZeroLineProperties value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls- See Also:
-
getGradationZeroLineProperties
Properties for the gradation line drawn for zero (slightly thicker by default).- Returns:
- Current gradationZeroLineProperties value. Default value is null
-
setLegendLabel
Forsingle-facet
charts embedded in a multi-facet main chart, thelegendLabel
defines the text of the legend label for this chart. The default text is thetitle
of the metric facet value of this value axis concatenated with thetitle
of thefixed facet value
in parentheses. Set thelegendLabel
to provide custom text for the legend label.- Parameters:
legendLabel
- New legendLabel value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls
-
getLegendLabel
Forsingle-facet
charts embedded in a multi-facet main chart, thelegendLabel
defines the text of the legend label for this chart. The default text is thetitle
of the metric facet value of this value axis concatenated with thetitle
of thefixed facet value
in parentheses. Set thelegendLabel
to provide custom text for the legend label.- Returns:
- Current legendLabel value. Default value is null
-
setLogBase
WhenuseLogGradations
, base value for logarithmic gradation lines. Gradation lines will be shown at every power of this value plus intervening values specified bylogGradations
.- Parameters:
logBase
- New logBase value. Default value is 10- Returns:
MetricSettings
instance, for chaining setter calls
-
getLogBase
public int getLogBase()WhenuseLogGradations
, base value for logarithmic gradation lines. Gradation lines will be shown at every power of this value plus intervening values specified bylogGradations
.- Returns:
- Current logBase value. Default value is 10
-
setLogGradations
WhenuseLogGradations
is set, gradation lines to show in between powers, expressed as a series of integer or float values between 1 andlogBase
.Some common possibilities (for base 10):
[ 1 ] // show only orders of magnitude (0.1, 1, 10, 100, etc) [ 1, 5 ] // show only orders of magnitude plus halfway mark [ 1, 2, 4, 8 ] // show powers of 2 between orders [ 1, 2.5, 5, 7.5 ] // show quarters
Or base 2:[ 1 ] [ 1, 1.5 ]
- Parameters:
logGradations
- New logGradations value. Default value is [ 1,2,4,6,8 ]- Returns:
MetricSettings
instance, for chaining setter calls
-
getLogGradations
public float[] getLogGradations()WhenuseLogGradations
is set, gradation lines to show in between powers, expressed as a series of integer or float values between 1 andlogBase
.Some common possibilities (for base 10):
[ 1 ] // show only orders of magnitude (0.1, 1, 10, 100, etc) [ 1, 5 ] // show only orders of magnitude plus halfway mark [ 1, 2, 4, 8 ] // show powers of 2 between orders [ 1, 2.5, 5, 7.5 ] // show quarters
Or base 2:[ 1 ] [ 1, 1.5 ]
- Returns:
- Current logGradations value. Default value is [ 1,2,4,6,8 ]
-
setLogScale
Whether to use logarithmic scaling for values.Logarithmic scale charts show an equivalent percentage increase as equivalent distance on the chart. That is, 10 and 100 are the same distance apart as 100 and 1000 (each being a 10 times or 1000% increase).
- Parameters:
logScale
- New logScale value. Default value is false- Returns:
MetricSettings
instance, for chaining setter calls
-
getLogScale
Whether to use logarithmic scaling for values.Logarithmic scale charts show an equivalent percentage increase as equivalent distance on the chart. That is, 10 and 100 are the same distance apart as 100 and 1000 (each being a 10 times or 1000% increase).
- Returns:
- Current logScale value. Default value is false
-
setMatchGradations
When this property is set to the metric of another MetricSettings object, the extra value axis and chart corresponding to these settings will use the same scale for the gradations as the extra value axis and chart of the other MetricSettings object. The value ofmatchGradations
can only be one of the metrics of the metric facet whose values will be displayed by the chart.- Parameters:
matchGradations
- New matchGradations value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls- See Also:
-
getMatchGradations
When this property is set to the metric of another MetricSettings object, the extra value axis and chart corresponding to these settings will use the same scale for the gradations as the extra value axis and chart of the other MetricSettings object. The value ofmatchGradations
can only be one of the metrics of the metric facet whose values will be displayed by the chart.- Returns:
- Current matchGradations value. Default value is null
- See Also:
-
setMinDataSpreadPercent
Same asFacetChart.minDataSpreadPercent
but affects only one metric. Default of null means that the chart-wide settingfacetChart.minDataSpreadPercent
will be used.- Parameters:
minDataSpreadPercent
- New minDataSpreadPercent value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls
-
getMinDataSpreadPercent
Same asFacetChart.minDataSpreadPercent
but affects only one metric. Default of null means that the chart-wide settingfacetChart.minDataSpreadPercent
will be used.- Returns:
- Current minDataSpreadPercent value. Default value is null
-
setMultiFacet
Whether this extra value axis plots values while varying the facet values of just the first facet (single-facet) or both first and second facets (multi-facet).- Parameters:
multiFacet
- New multiFacet value. Default value is true- Returns:
MetricSettings
instance, for chaining setter calls
-
getMultiFacet
Whether this extra value axis plots values while varying the facet values of just the first facet (single-facet) or both first and second facets (multi-facet).- Returns:
- Current multiFacet value. Default value is true
-
setProportional
For multi-facet charts, render data values as a proportion of the sum of all data values that have the same label.Gradation labels will be switched to show percentage instead of absolute values.
This setting is valid only for Column, Bar, Area and Radar chart types and only in
stacked
mode. Stacked columns will be as tall as the chart rect and stacked bars will be as wide as the chart rect. Area and Radar charts will be completely filled except for facet values where all values are 0.
If this method is called after the component has been drawn/initialized: Setter forproportional
.- Parameters:
proportional
- Whether the chart should now use proportional mode. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls- See Also:
-
getProportional
For multi-facet charts, render data values as a proportion of the sum of all data values that have the same label.Gradation labels will be switched to show percentage instead of absolute values.
This setting is valid only for Column, Bar, Area and Radar chart types and only in
stacked
mode. Stacked columns will be as tall as the chart rect and stacked bars will be as wide as the chart rect. Area and Radar charts will be completely filled except for facet values where all values are 0.- Returns:
- Current proportional value. Default value is null
- See Also:
-
setProportionalAxisLabel
Default title for the value axis label when the chart is inproportional rendering mode
. This title will be used unless thelegend facet
defines aproportionalTitle
.- Parameters:
proportionalAxisLabel
- New proportionalAxisLabel value. Default value is "Percent"- Returns:
MetricSettings
instance, for chaining setter calls
-
getProportionalAxisLabel
Default title for the value axis label when the chart is inproportional rendering mode
. This title will be used unless thelegend facet
defines aproportionalTitle
.- Returns:
- Current proportionalAxisLabel value. Default value is "Percent"
-
setShadowProperties
Properties for shadows.- Parameters:
shadowProperties
- New shadowProperties value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls- See Also:
-
getShadowProperties
Properties for shadows.- Returns:
- Current shadowProperties value. Default value is null
- See Also:
-
setShowAxis
Whether to show the extra value axis.- Parameters:
showAxis
- New showAxis value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls
-
getShowAxis
Whether to show the extra value axis.- Returns:
- Current showAxis value. Default value is null
-
setShowAxisLine
Whether to show an axis line for this extra value axis if it is not placed directly adjacent to the chart rect. The default setting is the value of theshowChartRect
property of the FacetChart.- Parameters:
showAxisLine
- New showAxisLine value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls
-
getShowAxisLine
Whether to show an axis line for this extra value axis if it is not placed directly adjacent to the chart rect. The default setting is the value of theshowChartRect
property of the FacetChart.- Returns:
- Current showAxisLine value. Default value is null
-
setShowDataPoints
For Line, Area, Radar, Scatter or Bubble charts, whether to show data points for each individual data value.If shown, the
pointClick()
andgetPointHoverHTML()
APIs can be used to create interactivity.- Parameters:
showDataPoints
- New showDataPoints value. Default value is false- Returns:
MetricSettings
instance, for chaining setter calls
-
getShowDataPoints
For Line, Area, Radar, Scatter or Bubble charts, whether to show data points for each individual data value.If shown, the
pointClick()
andgetPointHoverHTML()
APIs can be used to create interactivity.- Returns:
- Current showDataPoints value. Default value is false
-
setShowDataValues
Deprecated.in favor ofFacetChart.showDataValuesMode
, a compound setting that supports showing data-values in the chart and in hovers in various combinations. The equivalent to showDataValues:true isShowDataValuesMode.inChartOnly
orShowDataValuesMode.inChartOrHover
if showValueOnHover was also set to true.Should data values be shown as text labels near the shape representing the value, for example, above columns of a column chart, or adjacent to points in a line chart?If set to false, then data values will not be shown.
If set to true, data values will be shown unless the data density is high enough that labels will potentially overlap, in which case, data values will not be shown and hovers will be shown instead, in the same way as
showValueOnHover
shows hovers.- Parameters:
showDataValues
- New showDataValues value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls
-
getShowDataValues
Deprecated.in favor ofFacetChart.showDataValuesMode
, a compound setting that supports showing data-values in the chart and in hovers in various combinations. The equivalent to showDataValues:true isShowDataValuesMode.inChartOnly
orShowDataValuesMode.inChartOrHover
if showValueOnHover was also set to true.Should data values be shown as text labels near the shape representing the value, for example, above columns of a column chart, or adjacent to points in a line chart?If set to false, then data values will not be shown.
If set to true, data values will be shown unless the data density is high enough that labels will potentially overlap, in which case, data values will not be shown and hovers will be shown instead, in the same way as
showValueOnHover
shows hovers.- Returns:
- Current showDataValues value. Default value is null
-
setShowShadows
Whether to automatically show shadows for various charts.- Parameters:
showShadows
- New showShadows value. Default value is true- Returns:
MetricSettings
instance, for chaining setter calls- See Also:
-
getShowShadows
Whether to automatically show shadows for various charts.- Returns:
- Current showShadows value. Default value is true
- See Also:
-
setShowValueAxisLabel
Whether to show thevalueTitle
(or, in the case ofproportional rendering mode
,proportionalAxisLabel
) as a label on this extra value axis.- Parameters:
showValueAxisLabel
- New showValueAxisLabel value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls
-
getShowValueAxisLabel
Whether to show thevalueTitle
(or, in the case ofproportional rendering mode
,proportionalAxisLabel
) as a label on this extra value axis.- Returns:
- Current showValueAxisLabel value. Default value is null
-
setShowValueOnHover
Deprecated.in favor ofFacetChart.showDataValuesMode
, a compound setting that supports showing data-values in the chart and in hovers in various combinations. The equivalent to showValueOnHover:true is ShowDataValuesMode.inHoverOnly.Shows the value of the nearest data value in a floating label whenever the mouse moves within the main chart area. The visual element representing the data value will also be emphasized by brightening or highlighting it (appearance differs by chart type).Calculates nearest value based on
FacetChart.getNearestDrawnValue()
.The data value will be formatted using
FacetChart.setDataValueFormatter()
. The label's appearance is controlled byFacetChart.hoverLabelProperties
.- Parameters:
showValueOnHover
- New showValueOnHover value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls- See Also:
-
getShowValueOnHover
Deprecated.in favor ofFacetChart.showDataValuesMode
, a compound setting that supports showing data-values in the chart and in hovers in various combinations. The equivalent to showValueOnHover:true is ShowDataValuesMode.inHoverOnly.Shows the value of the nearest data value in a floating label whenever the mouse moves within the main chart area. The visual element representing the data value will also be emphasized by brightening or highlighting it (appearance differs by chart type).Calculates nearest value based on
FacetChart.getNearestDrawnValue()
.The data value will be formatted using
FacetChart.setDataValueFormatter()
. The label's appearance is controlled byFacetChart.hoverLabelProperties
.- Returns:
- Current showValueOnHover value. Default value is null
- See Also:
-
setStacked
If theChartType
is "Column" then the metric settings may include a setting forFacetChart.stacked
.
If this method is called after the component has been drawn/initialized: Method to changestacked
. Use null to apply a default value for the currentchartType
.- Parameters:
stacked
- new value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls
-
getStacked
If theChartType
is "Column" then the metric settings may include a setting forFacetChart.stacked
.- Returns:
- Current stacked value. Default value is null
-
setUseLogGradations
Whether to use classic logarithmic gradations, where each order of magnitude is shown as a gradation as well as a few intervening lines. Gradations also begin and end on an order of magnitude. For example, 1,2,4,6,8,10,20,40,60,80,100.Default gradations can be overridden via
logBase
andlogGradations
.- Parameters:
useLogGradations
- New useLogGradations value. Default value is false- Returns:
MetricSettings
instance, for chaining setter calls
-
getUseLogGradations
Whether to use classic logarithmic gradations, where each order of magnitude is shown as a gradation as well as a few intervening lines. Gradations also begin and end on an order of magnitude. For example, 1,2,4,6,8,10,20,40,60,80,100.Default gradations can be overridden via
logBase
andlogGradations
.- Returns:
- Current useLogGradations value. Default value is false
-
setValueAxisLabelProperties
Properties for labels of value axis.- Parameters:
valueAxisLabelProperties
- New valueAxisLabelProperties value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls- See Also:
-
getValueAxisLabelProperties
Properties for labels of value axis.- Returns:
- Current valueAxisLabelProperties value. Default value is null
-
setValueLineProperties
Properties for a "value line" - a line shows where a particular discrete value is placed, eg, vertical lines connecting points of a line chart to the X axis, or radial lines in a Radar chart.- Parameters:
valueLineProperties
- New valueLineProperties value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls- See Also:
-
getValueLineProperties
Properties for a "value line" - a line shows where a particular discrete value is placed, eg, vertical lines connecting points of a line chart to the X axis, or radial lines in a Radar chart.- Returns:
- Current valueLineProperties value. Default value is null
-
setValueTitle
A label for the data values, such as "Sales in Thousands", typically used as the label for the value axis.- Parameters:
valueTitle
- New valueTitle value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls
-
getValueTitle
A label for the data values, such as "Sales in Thousands", typically used as the label for the value axis.- Returns:
- Current valueTitle value. Default value is null
-
setXAxisEndValue
Same asFacetChart.xAxisEndValue
but affects only one metric.- Parameters:
xAxisEndValue
- New xAxisEndValue value. Default value is null- Returns:
MetricSettings
instance, for chaining setter calls
-
getXAxisEndValue
Same asFacetChart.xAxisEndValue
but affects only one metric.- Returns:
- Current xAxisEndValue value. Default value is null
-
getGradations
public float[] getGradations()Return an array of the gradation values used in the current chart. Pass these values togetXCoord()
/getYCoord()
(depending on the orientation of the chart) to discover the coordinates where gradations are drawn.This is only allowed to be called when
FacetChart.chartDrawn()
fires.- Returns:
- an array of gradation values used in the current chart.
-
getXCoord
public float getXCoord(float value) Deprecated.Returns the X coordinate where the passed data value either was or would be drawn. For example, this would be the X coordinate where a bar would end in a bar chart.This is only allowed to be called after
FacetChart.chartDrawn()
fires.If the
chartType
isChartType.BAR
,ChartType.BUBBLE
, orChartType.SCATTER
then thevalue
argument should be a number. For other rectangular charts, this method expects aFacetValueMap
that uniquely identifies the data cell whose X-axis coordinate is to be retrieved.Note that when
canZoom
is enabled, this API is valid only for data values betweenzoomStartValue
andzoomEndValue
.- Parameters:
value
- the value to be drawn.- Returns:
- the X coordinate where the passed data value would be drawn; or null if the passed
FacetValueMap
does not identify a currently-drawn data cell.
-
getXCoordAsDouble
Returns the X coordinate where the passed data value either was or would be drawn. For example, this would be the X coordinate where a bar would end in a bar chart.This is only allowed to be called after
FacetChart.chartDrawn()
fires.If the
chartType
isChartType.BAR
,ChartType.BUBBLE
, orChartType.SCATTER
then thevalue
argument should be a number. For other rectangular charts, this method expects aFacetValueMap
that uniquely identifies the data cell whose X-axis coordinate is to be retrieved.Note that when
canZoom
is enabled, this API is valid only for data values betweenzoomStartValue
andzoomEndValue
.- Parameters:
value
- the value to be drawn.- Returns:
- the X coordinate where the passed data value would be drawn; or null if the passed
FacetValueMap
does not identify a currently-drawn data cell.
-
getYCoord
public float getYCoord(float value) Deprecated.Returns the Y coordinate where the passed data value either was or would be drawn. For example, this would be the Y coordinate that a line would pass through on a line chart, or the top of a column on a column chart.This is only allowed to be called after
FacetChart.chartDrawn()
fires.If the
chartType
isChartType.AREA
,ChartType.BUBBLE
,ChartType.COLUMN
,ChartType.HISTOGRAM
,ChartType.LINE
, orChartType.SCATTER
then thevalue
argument should be a number. ForChartType.BAR
charts this method expects aFacetValueMap
that uniquely identifies the data cell whose Y-axis coordinate is to be retrieved.- Parameters:
value
- the value to be drawn.- Returns:
- the Y coordinate where the passed data value would be drawn.
-
getYCoordAsDouble
public double getYCoordAsDouble(double value) Returns the Y coordinate where the passed data value either was or would be drawn. For example, this would be the Y coordinate that a line would pass through on a line chart, or the top of a column on a column chart.This is only allowed to be called after
FacetChart.chartDrawn()
fires.If the
chartType
isChartType.AREA
,ChartType.BUBBLE
,ChartType.COLUMN
,ChartType.HISTOGRAM
,ChartType.LINE
, orChartType.SCATTER
then thevalue
argument should be a number. ForChartType.BAR
charts this method expects aFacetValueMap
that uniquely identifies the data cell whose Y-axis coordinate is to be retrieved.- Parameters:
value
- the value to be drawn.- Returns:
- the Y coordinate where the passed data value would be drawn.
-
setPointHoverCustomizer
Display custom HTML whenshowDataPoints
is true and the mouse hovers over a point.- Parameters:
hoverCustomizer
-
-
setPointClickHandler
Apply a handler to fire whenshowDataPoints
is true, and the user clicks on a point.- Parameters:
handler
-
-
setAxisValueFormatter
Formatter to apply to values displayed in the gradation labels.- Parameters:
formatter
- Formatter to apply to values displayed in the gradation labels
-
setDataValueFormatter
Formatter to apply to values displayed in the hover labels and other value labels- Parameters:
formatter
- Formatter to apply to values displayed in the hover labels and other value labels
-
getDataColor
Get a color from thedataColors
Array. The colors returned by this method define what colors are used for the data in the chart.This is not an override point, but you can provide your own function by setting a customizer with
setDataColorMapper()
.- Parameters:
index
- index of the visual element to be coloredfacetValueId
- id of the facet value to be coloredpurpose
- purpose for the requested color - such as "legend", "line", "area", "points", etc.- Returns:
- chosen color
- See Also:
-
getDataColor
-
getDataColor
-
getDataColor
-
getDataColor
-
setDataColorMapper
Sets a customizer to redefine what colors are used when rendering the chart data.- Parameters:
colorMapper
- the customizer redefining what colors are used for chart data- See Also:
-
setDataLineColorMapper
Sets a customizer to redefine what colors are used when rendering lines for the chart data. No default implementation. If not defined or null is returned, the Framework will default to using the datacolor - eithergetDataColor()
or theColorMapper
installed bysetDataColorMapper()
if one has been provided.- Parameters:
colorMapper
- the customizer redefining what line colors are used for chart data- See Also:
-
setDataGradientMapper
Sets a customizer to redefine what gradients are used when rendering the chart data.- Parameters:
gradientMapper
- the customizer redefining what gradients are used for chart data- See Also:
-
FacetChart.showDataValuesMode
, a compound setting that supports showing data-values in the chart and in hovers in various combinations.