public class HighstockRenderer extends Object
The HighstockRenderer 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.
HighstockRenderer renderer = new HighstockRenderer();
...
Highstock hs = new YourChart().configure();
globalOptionsJs = renderer.toJs(hs.getGlobalOptions()); // if required
chartOptionsJs = renderer.toJs(hs.getChartOptions());
Highstock hs2 = new YourChart2().configure();
globalOptionsJs = renderer.toJs(hs2.getGlobalOptions()); // if required
chartOptionsJs = renderer.toJs(hs2.getChartOptions());
....
Constructor and Description |
---|
HighstockRenderer() |
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.