D - type of data to put into getData() listC - type of the configuration object for this chartpublic final class Chart<D,C extends Config> extends Object
createBar(net.java.html.charts.Values.Set...),
createLine(net.java.html.charts.Values.Set...), createPie(), etc.)
methods and should first be filled with data:
chart.getData().add(....);
and then displayed on the HTML page by attaching it to an existing
DOM element identified by an ID:
chart.applyTo("elementId");
| Modifier and Type | Method and Description |
|---|---|
void |
addChartListener(ChartListener l)
Adds a listener to the chart.
|
void |
applyTo(String id)
Associates the chart with an element on the page.
|
static Chart<Values,Config> |
createBar(Values.Set... dataSets)
Creates new bar chart.
|
static Chart<Segment,Config> |
createDoughnut()
Creates new doughnut (e.g.
|
static Chart<Values,Config> |
createLine(Values.Set... dataSets)
Creates new line based chart.
|
static Chart<Segment,Config> |
createPie()
Creates new pie chart.
|
static Chart<Segment,Config> |
createPolar()
Creates new radar (e.g.
|
static Chart<Values,Config> |
createRadar(Values.Set... dataSets)
Creates new radar chart.
|
void |
destroy()
Destroy the graph and cleanup associated resources.
|
C |
getConfig()
Access to configuration associated with this graph.
|
List<D> |
getData()
The data displayed by this graph.
|
void |
removeChartListener(ChartListener l)
Removes a listener from the chart.
|
public void applyTo(String id)
id - the id of the element to place the chart toIllegalStateException - if already applied to some elementpublic void addChartListener(ChartListener l)
l - the listenerpublic void removeChartListener(ChartListener l)
l - the listenerpublic C getConfig()
Config object, or a specialized one
tailored for the features of this chart.null configuration object for this chartpublic List<D> getData()
public void destroy()
public static Chart<Values,Config> createLine(Values.Set... dataSets)
dataSets - individual sets of values to displayfilled with data and
displayed.public static Chart<Values,Config> createRadar(Values.Set... dataSets)
dataSets - individual sets of values to displayfilled with data and
displayed.public static Chart<Values,Config> createBar(Values.Set... dataSets)
dataSets - individual sets of values to displayfilled with data and
displayed.public static Chart<Segment,Config> createPie()
filled with data and
displayed.public static Chart<Segment,Config> createDoughnut()
pie with missing center) chart.filled with data and
displayed.Copyright © 2017. All rights reserved.