public interface AQChart
Synopsis:
Chart renders a graphical representation of a set of data, using a series & category data format.
Description:
Chart provides an interface to render an image of a data set.
This interface includes methods to access the underlying data model and properties that govern different aspects of the chart's appearance.
Once the model is populated with data and the properties are configured, then a chart image can be rendered to a byte array or can be cached for access
through a url.
Modifier and Type | Method and Description |
---|---|
void |
addCategoryField(String categoryFieldName)
Select category from a field in the datasource
|
void |
addSeriesField(String seriesFieldName)
Add a series from the datasource to the AQChartModel
|
String |
cache(int timeToLive)
Renders a chart and inserts the resulting image into an image cache, returning a URL string
which can be used to access the generated chart.
|
List<String> |
getCategoryFields()
Get the list of datasource category fields used by the AQChartModel
|
AQDataSource |
getDataSource()
Get the AQChartModel's datasource.
|
AQChartModel |
getModel()
Get the Chart's data model.
|
AQChartProperties |
getProperties()
Get the Chart's properties.
|
List<String> |
getSeriesFields()
Get the list of datasource series fields used by the AQChartModel
|
boolean |
isCacheValid(String cacheKey)
Determines whether the specified cache key is still valid (based on its timeToLive)
|
byte[] |
renderToImage(String imageFormat)
Render the Chart to an array of bytes, using the specified image file format
|
void |
setCategoryFields(String... categoryFieldNames)
Select categories from one or more fields in the datasource
|
void |
setDataSource(AQDataSet dataSet)
Use the specified AQDataSet as the AQChartModel's datasource
|
void |
setDataSource(AQDataSource dataSource)
Use the specified AQDataSource as the AQChartModel's datasource
|
void |
setDataSource(AQPivotDataSet pivotDataSet)
Use the specified AQPivotDataSet as the AQChartModel's datasource
|
void |
setModel(AQChartModel model)
Set the Chart's data model.
|
void |
setProperties(AQChartProperties chartProperties)
Set the Chart's properties.
|
void |
setSeriesFields(String... seriesFieldNames)
Select series from one or more fields in the datasource
|
AQChartModel getModel()
void setModel(AQChartModel model)
model
- set the underlying data modelAQChartProperties getProperties()
void setProperties(AQChartProperties chartProperties)
chartProperties
- Properties which define how the chart will be rendered (chart types, functions, colors, fonts, etc)void setDataSource(AQDataSet dataSet)
dataSet
- AQDataSet containing rows and columns of datavoid setDataSource(AQPivotDataSet pivotDataSet)
pivotDataSet
- AQPivotDataSet containing rows and columns of datavoid setDataSource(AQDataSource dataSource)
dataSource
- AQDataSource containing rows and columns of dataAQDataSource getDataSource()
void addSeriesField(String seriesFieldName)
seriesFieldName
- Name of field in datasourceList<String> getSeriesFields()
void setSeriesFields(String... seriesFieldNames)
seriesFieldNames
- Names of fields in datasourcevoid addCategoryField(String categoryFieldName)
categoryFieldName
- Name of field in datasourceList<String> getCategoryFields()
void setCategoryFields(String... categoryFieldNames)
categoryFieldNames
- Name of field in datasourcebyte[] renderToImage(String imageFormat) throws Exception
imageFormat
- Image format ("jpg" or "png")Exception
- during the rendering of the image (e.g. if the specified image format is invalid or unsupported)String cache(int timeToLive) throws Exception
timeToLive
- Time period in seconds during which the image will remain in the cache.Exception
- if timeToLive < 0; if exception occurs during the rendering of the imageboolean isCacheValid(String cacheKey)
cacheKey
- Cache entry key
Copyright © 2017 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.