Class AbstractChartMeasures<S extends AbstractChartSeries<?,S>,M extends AbstractChartMeasures<S,M>>

Object
ObjectIdentity
BacklinkBuilder<S>
AbstractChartMeasures<S,M>
Direct Known Subclasses:
BoxplotChart.BoxplotAdditionalMeasure, ChartMeasures.Basic

public class AbstractChartMeasures<S extends AbstractChartSeries<?,S>,M extends AbstractChartMeasures<S,M>> extends BacklinkBuilder<S>
Common base class for the "additional measure" builders returned by a concrete series type's own addAdditionalMeasure() method, for example ScatterChart.ScatterAdditionalMeasure or BarLineChart.BarLineAdditionalMeasure. You never instantiate this class or a concrete subclass of it directly.

An additional measure lets a series plot more than one numeric measure, each configured independently: which field or expression it comes from (setMeasure(String), withExpression()), how it is aggregated (withAggregation(AggregationFormula) and the withPercent()/ withPerUnit()/withAverage()/withTotal() shortcuts), and its own label (setLabel(String)). Most of this class's methods are declared protected here and selectively re-exposed as public by intermediate tier classes in ChartMeasures (ChartMeasures.Basic, ChartMeasures.Type, ChartMeasures.EmbeddedBoxplot), mirroring how AbstractChartSeries exposes its own optional methods. Not every chart type extends one of these tiers at all: BoxplotChart.BoxplotAdditionalMeasure extends this class directly. Consult a concrete type's own public methods to see which of these are actually available on it.

See Also:
  • Constructor Details

    • AbstractChartMeasures

      public AbstractChartMeasures(S backLink, String instanceId)
  • Method Details

    • getThis

      protected M getThis()
    • setMeasure

      public final M setMeasure(String measure)
      Sets the Datamart field this additional measure aggregates.
      Parameters:
      measure - the technical name of the field to aggregate
      Returns:
      this additional measure, for chaining further configuration
      See Also:
    • setId

      public final M setId(int measureId)
      Assigns an explicit numeric ID to this additional measure, overriding the automatically generated one.
      Parameters:
      measureId - the ID to assign to this additional measure
      Returns:
      this additional measure, for chaining further configuration
    • withExpression

      public final Expression<M> withExpression()
      Returns the builder for computing this additional measure from a Datamart Expression instead of a plain field set with setMeasure(String). Call Expression.setExpression(String) on the returned builder to supply the expression, and optionally Expression.setDefaultValue(java.math.BigDecimal) and Expression.setDescription(String).
      Returns:
      a new Expression builder for this additional measure. Never null.
      See Also:
    • withAggregation

      protected M withAggregation(String aggregationFunction)
      Sets the aggregation formula for this additional measure by its raw string name, for cases not covered by the withAggregation(AggregationFormula) overload or the withPercent()/ withPerUnit()/withAverage()/withTotal() shortcuts. Declared protected here; a concrete additional-measure type re-exposes it as public via ChartMeasures.Basic (or a subclass of it).
      Parameters:
      aggregationFunction - the name of an AggregationFormula constant, or another aggregation identifier the Data Analyzer recognizes
      Returns:
      this additional measure, for chaining further configuration
      See Also:
    • withAggregation

      protected M withAggregation(AggregationFormula aggregationFunction)
      Sets the aggregation formula for this additional measure. Declared protected here; a concrete additional-measure type re-exposes it as public via ChartMeasures.Basic (or a subclass of it). The withPercent(), withPerUnit(), withAverage(), and withTotal() methods are shortcuts for the most common formulas that avoid passing the enum constant directly.
      Parameters:
      aggregationFunction - the aggregation formula to apply
      Returns:
      this additional measure, for chaining further configuration
      See Also:
    • withFormula

      protected M withFormula()
      Marks this additional measure as computed from a named Pricing Formula: the value previously set via setMeasure(String) is then treated as a Formula name rather than a plain Datamart field name. Declared protected here; a concrete additional-measure type re-exposes it as public via ChartMeasures.Basic (or a subclass of it).
      Returns:
      this additional measure, for chaining further configuration
      See Also:
    • withPercent

      protected M withPercent()
      Shorthand for withAggregation(AggregationFormula.PERCENT). Declared protected here; a concrete additional-measure type re-exposes it as public via ChartMeasures.Basic (or a subclass of it).
      Returns:
      this additional measure, for chaining further configuration
    • withPerUnit

      protected M withPerUnit()
      Shorthand for withAggregation(AggregationFormula.PERUNIT). Declared protected here; a concrete additional-measure type re-exposes it as public via ChartMeasures.Basic (or a subclass of it).
      Returns:
      this additional measure, for chaining further configuration
    • withAverage

      protected M withAverage()
      Shorthand for withAggregation(AggregationFormula.AVERAGE). Declared protected here; a concrete additional-measure type re-exposes it as public via ChartMeasures.Basic (or a subclass of it).
      Returns:
      this additional measure, for chaining further configuration
    • withTotal

      protected M withTotal()
      Shorthand for summing this additional measure's values (the Data Analyzer's "Sum" aggregation option). Declared protected here; a concrete additional-measure type re-exposes it as public via ChartMeasures.Basic (or a subclass of it).
      Returns:
      this additional measure, for chaining further configuration
    • setType

      protected M setType(SeriesType seriesType)
      Sets how this additional measure itself is rendered, independently of its series' overall type, for example rendering an additional measure as a line overlaid on a bar series. Declared protected here; a concrete additional-measure type re-exposes it as public via ChartMeasures.Type (or a subclass of it).
      Parameters:
      seriesType - the rendering type to use for this additional measure
      Returns:
      this additional measure, for chaining further configuration
    • setOnZAxis

      protected M setOnZAxis(Boolean onZAxis)
      Plots this additional measure on the chart's secondary Z axis instead of alongside the series' primary measure. Declared protected here; a concrete additional-measure type re-exposes it as public via ChartMeasures.Type (or a subclass of it), or overrides it directly as BoxplotChart.BoxplotAdditionalMeasure does.
      Parameters:
      onZAxis - true to plot this measure on the Z axis; false or null to plot it alongside the primary measure
      Returns:
      this additional measure, for chaining further configuration
    • setLabel

      public M setLabel(String measureLabel)
      Sets this additional measure's own display label, shown in the chart's legend and tooltips, independent of the series' own label.
      Parameters:
      measureLabel - the label to display for this additional measure
      Returns:
      this additional measure, for chaining further configuration
    • withBoxplotField

      protected M withBoxplotField()
      Marks this additional measure as the field supplying an embedded box plot overlay, analogous to AbstractChartSeries.setBoxplotAxis() at the series level. Declared protected here; a concrete additional-measure type re-exposes it as public via ChartMeasures.EmbeddedBoxplot.
      Returns:
      this additional measure, for chaining further configuration
      See Also:
    • withBoxplotExpression

      protected Expression<M> withBoxplotExpression()
      Returns the builder for computing this additional measure's embedded box plot overlay from a Datamart Expression instead of a plain field set with withBoxplotField(). Declared protected here; a concrete additional-measure type re-exposes it as public via ChartMeasures.EmbeddedBoxplot.
      Returns:
      a new Expression builder for the boxplot overlay. Never null.
      See Also: