public class ApexchartRenderer extends Object
The ApexchartRenderer class can be used to generate JSON for ChartOptions or 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.
ApexchartRenderer renderer = new ApexchartRenderer();
...
Apexchart ap = new YourChart().configure();
*
chartOptionsJs = renderer.toJs(ap.getChartOptions());
Apexchart ap2 = new YourChart2().configure();
*
chartOptionsJs = renderer.toJs(ap2.getChartOptions());
....
Constructor and Description |
---|
ApexchartRenderer() |
Modifier and Type | Method and Description |
---|---|
String |
toJs(ChartOptions chartOptions)
Converts chart options to JSON.
|
String |
toJs(Object object)
Converts any model class to JSON.
|
public String toJs(ChartOptions chartOptions)
chartOptions
- the chart options object.Copyright © 2024. All rights reserved.