public interface AQChartModel
Synopsis:
ChartModel contains the data to be rendered in the chart.
Description:
ChartModel provides an interface to query and modify the chart's underlying data set.
Values are stored as a list of rows, with each row containing a category value and a list of series values (one value for each series).
Note that category values are not unique, and the same category value can appear in multiple rows.
The list of series is created and queried using these methods:
addSeries(String name)
addSeries(String ... names)
setSeries(int index, String name)
Once the series are defined, then values can be specified individually using:
setValue(int seriesNumber, int categoryNumber, Number value)
Or, rows of values can be specified using:
addRow(Object category, List <Number> values)
addRow(int rowIndex, Object category, List <Number> values)
Note that the list of values contains a value from each series. These values are all associated with the specified category.
The ChartModel provides a set of statistics for each series, each category and for the entire dataset.
These statistics include totals, min/max, range
ChartModel data can be obtained from an AQDataSource.
Once the DataSource is specified, then the category & series values can be populated by selecting DataSource fields using these methods:
addCategoryField(String field)
addSeriesField(String field)
setCategoryFieldNumbers(Integer ... fieldIndexes)
setCategoryFields(String ... fields)
setSeriesFieldNumbers(Integer ... fieldIndexes)
setSeriesFields(String ... fields)
Values are also summarized by country when the category values contain country names/ids.
This geographic categorization is visualized in the Map chart, which highlights countries based on these totals.
The default country identifiers use the standard ISO2, ISO3, FIPS & GMI codes.
These identifiers can be modified using these methods:
resetCountryNameMap()
addCountryNameMapping(String defaultCountryNameMapping, String newCountryNameMapping)
removeCountryNameMapping(String countryNameMapping)
Modifier and Type | Method and Description |
---|---|
void |
addCategory(Object category)
Add category with the specified value (String, Number or Date)
|
void |
addCategoryField(String categoryFieldName)
Select category from a field in the datasource
|
void |
addCountryNameMapping(String defaultCountryName,
String newCountryNameMapping)
Map the specified name to the specified country
|
AQChartRow |
addRow(Object category,
Number... values)
Add a row of data containing the specified Category and an array of numbers, one for each series.
|
void |
addSeries(String... series)
Add an array of series names
|
void |
addSeries(String series)
Add a series with the specified name
|
void |
addSeriesField(String seriesFieldName)
Add a series of values from the specified field in the current DataSource
|
void |
clearCountryNameMap()
Clear all country name mappings.
|
void |
clearRows()
Remove all rows
|
void |
clearSeries()
Remove all series
|
Object |
getCategory(int categoryNumber)
Get the category object at the specified row index.
|
double |
getCategoryAxisDivisor()
Get the Divisor used to subdivide the category axis
|
double |
getCategoryAxisMax()
Get the Maximum value on the category axis
|
double |
getCategoryAxisMin()
Get the Minimum value on the category axis
|
double |
getCategoryAxisMinSeparation()
Get the Minimum separation between category axis values
|
double |
getCategoryAxisRange()
Get the Size of range on the category axis
|
double |
getCategoryAxisSubdivisions()
Get the Number of subdivisions along the range of the category axis
|
int |
getCategoryCount()
Get the number of categories
|
List<String> |
getCategoryFields()
Get the list of datasource fields containing category values
|
double |
getCategoryTotal(int categoryNumber)
Get the Total of all series values in the specified category
|
double |
getCategoryTotalNegative(int categoryNumber)
Get the Total of all negative series values in the specified category
|
double |
getCategoryTotalPositive(int categoryNumber)
Get the Total of all positive series values in the specified category
|
Double |
getCountryMax(int seriesNumber)
Get the Maximum value of all per-country totals (sum of all values for a specified series and country, regardless of identifier (e.g.
|
Double |
getCountryMin(int seriesNumber)
Get the Minimum value of all per-country totals (sum of all values for a specified series and country, regardless of identifier (e.g.
|
Double |
getCountryValue(String countryId,
int seriesNumber)
Get the Sum of all series values for the specified country
|
Double |
getCountryValueByIndex(int countryIndex,
int seriesNumber)
Get the Sum of all series values for the specified country
|
AQDataSource |
getDataSource()
Get the chart model's underlying DataSource (for example, an AQDataSet or AQPivotDataSet).
|
double |
getDivisor()
Get the Divisor used when all series are merged
|
double |
getDivisor(int seriesNumber)
Get the Divisor used for the specified series
|
double |
getDivisorTotal()
Get the Divisor used to subdivide the total range
|
double |
getMaximumAxisValue()
Get the Maximum value for all series
|
double |
getMaximumAxisValue(int seriesNumber)
Get the Maximum value in series
|
double |
getMaximumValue()
Get the Maximum value across all series
|
double |
getMaximumValue(int seriesNumber)
Get the Maximum value in series
|
double |
getMinimumAxisValue()
Get the Minimum value for all series
|
double |
getMinimumAxisValue(int seriesNumber)
Get the Minimum value in series
|
double |
getMinimumValue()
Get the Minimum value across all series
|
double |
getMinimumValue(int seriesNumber)
Get the Minimum value in series
|
double |
getRange()
Get the Size of range when all series are merged
|
double |
getRange(int seriesNumber)
Get the Size of the numeric range for the specified series
|
double |
getRangeTotal()
Get the Size of numeric range between total positive & total negative
|
AQChartRow |
getRow(int rowNumber)
Get the row at the specified index
|
int |
getRowCount()
Return the number of rows in the model
|
List<AQChartRow> |
getRows()
Get the list of rows
|
List<Number> |
getRowValues(int rowNumber)
Get the List of values at specified row
|
List<String> |
getSeries()
Get the list of series names
|
String |
getSeries(int seriesNumber)
Get the series name at the specified index
|
int |
getSeriesCount()
Get the number of series
|
List<String> |
getSeriesFields()
Get the list of datasource fields containing series values
|
double |
getSubdivisions()
Get the Number of subdivisions on range when all series are merged
|
double |
getSubdivisions(int seriesNumber)
Get the Number of subdivisions on a series range
|
double |
getSubdivisionsTotal()
Get the Number of subdivisions on the total range
|
double |
getTotal(int seriesNumber)
Get the Total of all values in the specified series
|
double |
getTotalAbsolute(int seriesNumber)
Get the Total of all absolute values in the specified series
|
double |
getTotalNegative()
Get the Sum of all series minima which are less than zero
|
double |
getTotalPositive()
Get the Sum of all series maxima which are greater than zero
|
Number |
getValue(int categoryNumber,
int seriesNumber)
Get the Value at specified category and series indices
|
AQChartRow |
insertRow(int index,
Object category,
Number... values)
Insert a row of data containing the specified Category and an array of numbers, one for each series.
|
void |
insertSeriesField(int seriesNumber,
String seriesFieldName)
Select a series field from the datasource and place it at the specified series index
|
boolean |
isUseNumericCategoryAxis()
Get the True if the category axis uses numeric values
|
void |
parseDataScript(String dataScript)
Parses string to generate model data
Script Format: category="[Category A], [Category B], [Category C]", series="[Series X], [Series Y]", values="1000,2000,3000,5,10,20" |
void |
removeCategory(Object category)
Remove first category which matches the specified category
|
void |
removeCategoryByIndex(int index)
Remove the category at the specified index
|
void |
removeCountryNameMapping(String countryNameMapping)
Remove the specified country name mapping.
|
AQChartRow |
removeRow(int index)
Remove the row at the specified index
|
void |
removeSeries(String series)
Remove first series with the specified name
|
void |
removeSeriesField(int seriesNumber)
Remove a series field
|
void |
resetCountryNameMap()
Reset the country name mappings to the defaults.
|
void |
setCategory(int categoryNumber,
Object category)
Set category at the specified index
|
void |
setCategoryFieldNumbers(Integer... categoryFieldNumbers)
Select categories from one or more fields in the datasource
|
void |
setCategoryFields(String... categoryFieldNames)
Select categories from one or more fields in the datasource
|
void |
setDataSource(AQDataSet dataSet)
Use the specified AQDataSet as the Chart Model's data source.
|
void |
setDataSource(AQDataSource dataSource)
Use the specified AQDataSource as the Chart Model's data source
|
void |
setDataSource(AQPivotDataSet pivotDataSet)
Use the specified AQPivotDataSet as the Chart Model's data source
|
void |
setMaximumAxisValue(double max)
Set the maximum value for all series
|
void |
setMaximumAxisValue(int seriesNumber,
double max)
Set the maximum value for the specified series
|
void |
setMinimumAxisValue(double min)
Set the minimum value for all series
|
void |
setMinimumAxisValue(int seriesNumber,
double min)
Set the minimum value for the specified series
|
void |
setMinimumMaximumAxisValues(double min,
double max)
Set both minimum and maximum values for all series
|
void |
setMinimumMaximumAxisValues(int seriesNumber,
double min,
double max)
Set both minimum and maximum values for the specified series
|
void |
setSeries(int seriesNumber,
String series)
Set the value of the specified series
|
void |
setSeriesFieldNumbers(Integer... seriesFieldNumbers)
Select series from one or more fields in the datasource
|
void |
setSeriesFields(String... seriesFieldNames)
Select series from one or more fields in the datasource
|
void |
setValue(int seriesNumber,
int categoryNumber,
Number value)
Set value at the specified series and category indices
|
void parseDataScript(String dataScript)
Note: values are in the order: [Series 0 Category 0], [Series 0 Category 1], [Series 0 Category 2], [Series 1 Category 0], ...
dataScript
- String in the format: 'category="[Category A], [Category B], [Category C]", series="[Series X], [Series Y]", values="1000,2000,3000,
5,10,20"'void setDataSource(AQDataSet dataSet)
Once the DataSource is specified, then the category & series values can be populated by selecting DataSource fields using these methods:
addCategoryField(String field)
addSeriesField(String field)
setCategoryFieldNumbers(Integer ... fieldIndexes)
setCategoryFields(String ... fields)
setSeriesFieldNumbers(Integer ... fieldIndexes)
setSeriesFields(String ... fields)
dataSet
- AQDataSet containing rows and columns of data. If null, then values must be explicitly added using the add/insert/set methods.AQDataSource getDataSource()
void setDataSource(AQDataSource dataSource)
Once the DataSource is specified, then the category & series values can be populated by selecting DataSource fields using these methods:
addCategoryField(String field)
addSeriesField(String field)
setCategoryFieldNumbers(Integer ... fieldIndexes)
setCategoryFields(String ... fields)
setSeriesFieldNumbers(Integer ... fieldIndexes)
setSeriesFields(String ... fields)
dataSource
- AQDataSource containing rows and columns of data. If null, then values must be explicitly added using the add/insert/set methods.void setDataSource(AQPivotDataSet pivotDataSet)
Once the DataSource is specified, then the category & series values can be populated by selecting DataSource fields using these methods:
addCategoryField(String field)
addSeriesField(String field)
setCategoryFieldNumbers(Integer ... fieldIndexes)
setCategoryFields(String ... fields)
setSeriesFieldNumbers(Integer ... fieldIndexes)
setSeriesFields(String ... fields)
pivotDataSet
- AQPivotDataSet containing rows and columns of data. If null, then values must be explicitly added using the add/insert/set methods.void addSeriesField(String seriesFieldName)
seriesFieldName
- Name of field in datasourcevoid insertSeriesField(int seriesNumber, String seriesFieldName)
seriesNumber
- Zero-based series indexseriesFieldName
- Name of field in datasourceList<String> getSeriesFields()
void setSeriesFields(String... seriesFieldNames)
seriesFieldNames
- Names of fields in datasourcevoid setSeriesFieldNumbers(Integer... seriesFieldNumbers)
seriesFieldNumbers
- Column numbers of fields in datasourcevoid removeSeriesField(int seriesNumber)
seriesNumber
- Zero-based series indexvoid addCategoryField(String categoryFieldName)
categoryFieldName
- Name of field in datasourceList<String> getCategoryFields()
void setCategoryFields(String... categoryFieldNames)
categoryFieldNames
- Name of field in datasourcevoid setCategoryFieldNumbers(Integer... categoryFieldNumbers)
categoryFieldNumbers
- Column numbers of field in datasourceString getSeries(int seriesNumber)
seriesNumber
- Zero-based series indexint getSeriesCount()
void addSeries(String series)
series
- Series namevoid addSeries(String... series)
series
- Array of series namesvoid removeSeries(String series)
series
- Series namevoid setSeries(int seriesNumber, String series)
seriesNumber
- Zero-based index of seriesseries
- Series namevoid clearSeries()
Object getCategory(int categoryNumber)
categoryNumber
- Zero-based index of categoryint getCategoryCount()
void addCategory(Object category)
category
- Category value (String, Number or Date)void removeCategory(Object category)
category
- Category valuevoid removeCategoryByIndex(int index)
index
- Index of categoryvoid setCategory(int categoryNumber, Object category)
categoryNumber
- Zero-based index of categorycategory
- Category valuevoid clearRows()
List<AQChartRow> getRows()
AQChartRow getRow(int rowNumber)
rowNumber
- Zero-based index of rowint getRowCount()
AQChartRow addRow(Object category, Number... values)
category
- Category object, allows null valuevalues
- Array of numbers, one for each seriesAQChartRow insertRow(int index, Object category, Number... values)
index
- Index at which row should be insertedcategory
- Category object, allows null valuevalues
- Array of numbers, one for each seriesAQChartRow removeRow(int index)
index
- Row indexvoid setValue(int seriesNumber, int categoryNumber, Number value)
seriesNumber
- Zero-based index of seriescategoryNumber
- Zero-based index of categoryvalue
- Value to setList<Number> getRowValues(int rowNumber)
rowNumber
- Zero-based index of rowNumber getValue(int categoryNumber, int seriesNumber)
categoryNumber
- Zero-based index of categoryseriesNumber
- Zero-based index of seriesdouble getRange(int seriesNumber)
seriesNumber
- Zero-based index of seriesdouble getMaximumValue()
double getMinimumValue()
double getMinimumValue(int seriesNumber)
seriesNumber
- Zero-based index of seriesdouble getMaximumValue(int seriesNumber)
seriesNumber
- Zero-based index of seriesdouble getMinimumAxisValue(int seriesNumber)
seriesNumber
- Zero-based index of seriesdouble getMaximumAxisValue(int seriesNumber)
seriesNumber
- Zero-based index of seriesdouble getMinimumAxisValue()
double getMaximumAxisValue()
void setMinimumAxisValue(int seriesNumber, double min)
seriesNumber
- Zero-based index of seriesmin
- New minimum valuevoid setMaximumAxisValue(int seriesNumber, double max)
seriesNumber
- Zero-based index of seriesmax
- New maximum valuevoid setMinimumAxisValue(double min)
min
- New minimum valuevoid setMaximumAxisValue(double max)
max
- New maximum valuevoid setMinimumMaximumAxisValues(double min, double max)
min
- New minimum valuemax
- New maximum valuevoid setMinimumMaximumAxisValues(int seriesNumber, double min, double max)
seriesNumber
- Zero-based index of seriesmin
- New minimum valuemax
- New maximum valuedouble getTotalPositive()
double getTotalNegative()
double getRangeTotal()
double getSubdivisionsTotal()
double getDivisorTotal()
double getSubdivisions(int seriesNumber)
seriesNumber
- Zero-based index of seriesdouble getDivisor(int seriesNumber)
seriesNumber
- Zero-based index of seriesdouble getSubdivisions()
double getDivisor()
double getRange()
double getTotal(int seriesNumber)
seriesNumber
- Zero-based index of seriesdouble getTotalAbsolute(int seriesNumber)
seriesNumber
- Zero-based index of seriesdouble getCategoryAxisMin()
double getCategoryAxisMax()
double getCategoryAxisDivisor()
double getCategoryAxisSubdivisions()
double getCategoryAxisRange()
double getCategoryAxisMinSeparation()
double getCategoryTotal(int categoryNumber)
categoryNumber
- Zero-based index of categorydouble getCategoryTotalPositive(int categoryNumber)
categoryNumber
- Zero-based index of categorydouble getCategoryTotalNegative(int categoryNumber)
categoryNumber
- Zero-based index of categoryboolean isUseNumericCategoryAxis()
Double getCountryValueByIndex(int countryIndex, int seriesNumber)
countryIndex
- Numeric country identifierseriesNumber
- Zero-based index of seriesDouble getCountryValue(String countryId, int seriesNumber)
countryId
- Country identifier (e.g. "US", "USA", "United States"...)seriesNumber
- Zero-based index of seriesDouble getCountryMin(int seriesNumber)
seriesNumber
- Zero-based index of seriesDouble getCountryMax(int seriesNumber)
seriesNumber
- Zero-based index of seriesvoid resetCountryNameMap()
void clearCountryNameMap()
void addCountryNameMapping(String defaultCountryName, String newCountryNameMapping)
defaultCountryName
- Default name of country to be mapped. Note: this country name is a reference to a default country mapping,
and cannot be null.newCountryNameMapping
- Name to be associated with the country specified in the first parameter. A null country name can be added to handle null
category values.void removeCountryNameMapping(String countryNameMapping)
countryNameMapping
- Name to be disassociated from its current country.
Copyright © 2017 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.