public class HighchartRenderer extends Object
The HighchartRenderer class can be used to generate JSON for GlobalOptions, ChartOptions and any model class.
Some performance benefits can be found in cases where thousands of charts are being generated, for example in batch processes.
Usage: Instantiate this class once and then use it to generate the JSON for multiple charts.
HighchartRenderer renderer = new HighchartRenderer();
...
Highchart hc = new YourChart().configure();
globalOptionsJs = renderer.toJs(hc.getGlobalOptions()); // if required
chartOptionsJs = renderer.toJs(hc.getChartOptions());
Highchart hc2 = new YourChart2().configure();
globalOptionsJs = renderer.toJs(hc2.getGlobalOptions()); // if required
chartOptionsJs = renderer.toJs(hc2.getChartOptions());
....
Constructor and Description |
---|
HighchartRenderer() |
Modifier and Type | Method and Description |
---|---|
String |
toJs(ChartOptions chartOptions)
Converts chart options to JSON.
|
String |
toJs(GlobalOptions globalOptions)
Converts global options to JSON.
|
String |
toJs(Object object)
Converts any model class to JSON.
|
public String toJs(GlobalOptions globalOptions)
globalOptions
- the global options object.public String toJs(ChartOptions chartOptions)
chartOptions
- the chart options object.Copyright © 2024. All rights reserved.