public class Apexchart extends Object
The Apexchart class wraps the ChartOptions class into one convenient class to
make usage as simple as possible.
Handles chart theming; the setting of chart options; generates JSON for ChartOptions or any model class.
The ChartOptions class maps directly to the ApexCharts chart options in the ApexCharts Options Reference.
Chart options are added to your web page using var chart = new ApexCharts(document.querySelector("#chart"), {ChartOptions});
All ApexCharts chart options can be set by getting a reference to ChartOptions from this class via getChartOptions().
Refer to the HyJavaApex documentation for examples on how to use this class.
Constructor and Description |
---|
Apexchart() |
Modifier and Type | Method and Description |
---|---|
String |
chartOptionsToJs()
Converts chart options to JSON.
|
ChartOptions |
getChartOptions()
Get a reference to the chartOptions object for the chart.
|
Theme |
getTheme()
Get the theme object for the chart.
|
static boolean |
isAllowEvaluationStats()
Are evaluation stats allowed to be collected.
|
static boolean |
isCompressOutput()
Get whether to compress all generated global and chart options.
|
static boolean |
isConvertFunctions()
Get whether to convert all functions so they can be converted back to functions in your JavaScript.
|
static boolean |
isEmitFunctionsAsString()
Get whether to emit all functions as a JSON string.
|
static void |
setAllowEvaluationStats(boolean allowEvaluationStats)
Set whether to allow evaluation stats to be collected.
|
static void |
setCompressOutput(boolean compressOutput)
Set whether to compress all generated global and chart options.
|
static void |
setEmitFunctionsAsString(boolean emitFunctionsAsString)
Set whether to emit all functions as a JSON string and convert them so they can be converted back to a function in your JavaScript.
|
static void |
setEmitFunctionsAsString(boolean emitFunctionsAsString,
boolean convertFunctions)
Set whether to emit all functions as a JSON string.
|
void |
setTheme(Theme theme)
Sets the theme for the chart.
|
String |
toJs(Object object)
Converts any model class to JSON.
|
public String chartOptionsToJs()
public ChartOptions getChartOptions()
public String toJs(Object object)
object
- the model class.public Theme getTheme()
public void setTheme(Theme theme)
theme
- The theme selected for the chart.public static boolean isEmitFunctionsAsString()
public static boolean isConvertFunctions()
public static void setEmitFunctionsAsString(boolean emitFunctionsAsString)
emitFunctionsAsString
- boolean whether to emit all functions as a JSON string.public static void setEmitFunctionsAsString(boolean emitFunctionsAsString, boolean convertFunctions)
emitFunctionsAsString
- boolean whether to emit all functions as a JSON string.convertFunctions
- boolean whether to convert all functions so they can be converted back to functions in your JavaScript.public static boolean isCompressOutput()
public static void setCompressOutput(boolean compressOutput)
compressOutput
- true or false.public static boolean isAllowEvaluationStats()
public static void setAllowEvaluationStats(boolean allowEvaluationStats)
allowEvaluationStats
- true or false.Copyright © 2024. All rights reserved.