Package net.pricefx.common.api.chart


package net.pricefx.common.api.chart
The value vocabulary of a chart definition.

These constants say which chart to draw, and how each series renders and aggregates its measure. They also say how the data is filtered, sorted and limited, and how the chart-specific features behave. Those features are heatmap coloring, box plot whiskers, waterfall columns and auxiliary lines.

You pass the constants to the fluent chart builders in net.pricefx.common.apibuilder.chart, which a logic obtains with PublicGroovyAPI.newChartBuilder(). The example below builds a bar chart of revenue by country, highest revenue first.


 api.newChartBuilder().newBarLine()
         .addSeries()
             .setLabel("Revenue by Country")
             .setDatamart("datamart_transaction")
             .setType(SeriesType.BAR)
             .setAxisX("Country")
             .setAxisY("InvoicePrice")
                 .withAggregation(AggregationFormula.SUM)
                 .back()
             .addFilters(FilterOperator.AND)
                 .addFilter("Year", FilterOperator.EQUAL, "2026")
                 .back()
             .withSortByAxisY(SortType.DESCENDING)
             .back()
         .build()
 

A quicker start is to build the chart in the Data Analyzer user interface. The View Expression function then shows the generated builder code, including the constants it selected.

Two enums in this package configure a multi-tier input rather than a chart. They are TieredValueSortType and TieredValueValidationType, and MultiTierInputBuilder takes them.

Reference

See Also: