@highcharts/dashboards
Version:
Highcharts Dashboards framework
211 lines (210 loc) • 7.73 kB
JavaScript
/* *
*
* (c) 2009-2026 Highsoft AS
*
* Integration of this software requires a license.
* - For commercial use, see www.highcharts.com/license
* - For non-commercial, see www.highcharts.com/license-eula
*
*
* Authors:
* - Karol Kołodziej
*
* */
;
import Component from '../Component.js';
import { merge } from '../../../Shared/Utilities.js';
import { uniqueKey } from '../../../Core/Utilities.js';
/* *
*
* Constants
*
* */
const HighchartsComponentDefaults = {
allowConnectorUpdate: true,
className: [
Component.defaultOptions.className,
`${Component.defaultOptions.className}-highcharts`
].join(' '),
chartClassName: 'chart-container',
chartID: 'chart-' + uniqueKey(),
chartOptions: {
series: []
},
chartConstructor: 'chart',
editableOptions: [
{
name: 'connectorName',
propertyPath: ['connector', 'id'],
type: 'select'
},
...Component.defaultOptions.editableOptions || [],
{
name: 'chartOptions',
type: 'nested',
nestedOptions: [{
name: 'chart',
options: [{
name: 'title',
propertyPath: ['chartOptions', 'title', 'text'],
type: 'input'
}, {
name: 'subtitle',
propertyPath: ['chartOptions', 'subtitle', 'text'],
type: 'input'
}, {
name: 'type',
propertyPath: ['chartOptions', 'chart', 'type'],
type: 'select',
selectOptions: [{
name: 'column',
iconURL: 'series-types/icon-column.svg'
}, {
name: 'line',
iconURL: 'series-types/icon-line.svg'
}, {
name: 'scatter',
iconURL: 'series-types/icon-scatter.svg'
}, {
name: 'pie',
iconURL: 'series-types/icon-pie.svg'
}]
}]
}, {
name: 'xAxis',
options: [{
name: 'title',
propertyPath: ['chartOptions', 'xAxis', 'title', 'text'],
type: 'input'
}, {
name: 'type',
propertyPath: ['chartOptions', 'xAxis', 'type'],
type: 'select',
selectOptions: [{
name: 'linear'
}, {
name: 'datetime'
}, {
name: 'logarithmic'
}]
}]
}, {
name: 'yAxis',
options: [{
name: 'title',
propertyPath: ['chartOptions', 'yAxis', 'title', 'text'],
type: 'input'
}, {
name: 'type',
propertyPath: ['chartOptions', 'yAxis', 'type'],
type: 'select',
selectOptions: [{
name: 'linear'
}, {
name: 'datetime'
}, {
name: 'logarithmic'
}]
}]
}, {
name: 'legend',
showToggle: true,
propertyPath: ['chartOptions', 'legend', 'enabled'],
options: [{
name: 'align',
propertyPath: ['chartOptions', 'legend', 'align'],
type: 'select',
selectOptions: [{
name: 'left'
}, {
name: 'center'
}, {
name: 'right'
}]
}]
}, {
name: 'tooltip',
showToggle: true,
propertyPath: ['chartOptions', 'tooltip', 'enabled'],
options: [{
name: 'split',
propertyPath: ['chartOptions', 'tooltip', 'split'],
type: 'toggle'
}]
}, {
name: 'dataLabels',
propertyPath: [
'chartOptions',
'plotOptions',
'series',
'dataLabels',
'enabled'
],
showToggle: true,
options: [{
name: 'align',
propertyPath: [
'chartOptions',
'plotOptions',
'series',
'dataLabels',
'align'
],
type: 'select',
selectOptions: [{
name: 'left'
}, {
name: 'center'
}, {
name: 'right'
}]
}]
}, {
name: 'credits',
showToggle: true,
propertyPath: ['chartOptions', 'credits', 'enabled'],
options: [{
name: 'name',
propertyPath: [
'chartOptions',
'credits',
'text'
],
type: 'input'
}, {
name: 'url',
propertyPath: [
'chartOptions',
'credits',
'href'
],
type: 'input'
}]
}]
}, {
name: 'chartConfig',
propertyPath: ['chartOptions'],
type: 'textarea'
}, {
name: 'chartClassName',
propertyPath: ['chartClassName'],
type: 'input'
}, {
name: 'chartID',
propertyPath: ['chartID'],
type: 'input'
}
],
editableOptionsBindings: merge(Component.defaultOptions.editableOptionsBindings, {
skipRedraw: [
'chartOptions',
'chartConfig'
]
})
};
/* *
*
* Default Export
*
* */
export default HighchartsComponentDefaults;