HighchartsChart constructor
HighchartsChart(
- HighchartsOptions options, {
- Key? key,
- String? css,
- bool debug = kDebugMode,
- String? javaScript,
- List<
String> javaScriptModules = const ['https://code.highcharts.com/highcharts.js', 'https://code.highcharts.com/highcharts-more.js', 'https://code.highcharts.com/highcharts-3d.js', 'https://code.highcharts.com/modules/solid-gauge.js', 'https://code.highcharts.com/modules/annotations.js', 'https://code.highcharts.com/modules/boost.js', 'https://code.highcharts.com/modules/broken-axis.js', 'https://code.highcharts.com/modules/data.js', 'https://code.highcharts.com/modules/exporting.js', 'https://code.highcharts.com/modules/offline-exporting.js', 'https://code.highcharts.com/modules/accessibility.js'], - Map<
String, void Function(Object?)> events = const {}, - bool keepAlive = true,
- Widget onError()?,
- FutureOr<
void> onLoaded()?, - Widget onLoading()?,
Implementation
HighchartsChart(
this.options, {
super.key,
this.css,
this.debug = kDebugMode,
this.javaScript,
this.javaScriptModules = const [
'https://code.highcharts.com/highcharts.js',
'https://code.highcharts.com/highcharts-more.js',
'https://code.highcharts.com/highcharts-3d.js',
'https://code.highcharts.com/modules/solid-gauge.js',
'https://code.highcharts.com/modules/annotations.js',
'https://code.highcharts.com/modules/boost.js',
'https://code.highcharts.com/modules/broken-axis.js',
'https://code.highcharts.com/modules/data.js',
'https://code.highcharts.com/modules/exporting.js',
'https://code.highcharts.com/modules/offline-exporting.js',
'https://code.highcharts.com/modules/accessibility.js',
],
this.events = const {},
this.keepAlive = true,
this.onError,
this.onLoaded,
this.onLoading,
}) {
final String json = options.toJSON();
if (debug) {
debugPrint(json);
}
view = HighchartsView(
debug: debug,
keepAlive: keepAlive,
head: css == null ? null : HighchartsHelpers.styleTag(css),
body: javaScriptModules.map(HighchartsHelpers.scriptTag).join('\n'),
foot: [
'''
highcharts_flutter.debug=${debug};
highcharts_flutter.factory=Highcharts.chart;
''',
javaScript,
'highcharts_flutter.init($json);',
].map(HighchartsHelpers.scriptTag).join('\n'),
onError: (onError != null
? (_, error) {
return onError!(this, error);
}
: null),
onLoaded: (onLoaded != null
? (_) {
return onLoaded!(this);
}
: null),
onLoading: (onLoading != null
? (_) {
return onLoading!(this);
}
: null),
);
}