Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
junedchhipa committed Jul 14, 2024
1 parent da087c5 commit b586399
Showing 1 changed file with 27 additions and 16 deletions.
43 changes: 27 additions & 16 deletions src/modules/Core.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ export default class Core {
})

gl.dom.Paper.node.style.background =
cnf.theme.mode === 'dark' && !cnf.chart.background
? '#424242'
: cnf.theme.mode === 'light' && !cnf.chart.background
cnf.theme.mode === 'dark' && !cnf.chart.background
? '#424242'
: cnf.theme.mode === 'light' && !cnf.chart.background
? '#fff'
: cnf.chart.background

Expand Down Expand Up @@ -254,14 +254,12 @@ export default class Core {
if (comboCount > 0) {
if (nonComboType !== null) {
console.warn(
'Chart or series type ',
nonComboType,
' can not appear with other chart or series types.'
'Chart or series type ',
nonComboType,
' can not appear with other chart or series types.'
)
}
if (columnSeries.series.length > 0
&& cnf.plotOptions.bar.horizontal
) {
if (columnSeries.series.length > 0 && cnf.plotOptions.bar.horizontal) {
// horizontal bars not supported in mixed charts
comboCount -= columnSeries.length
columnSeries = {
Expand Down Expand Up @@ -291,7 +289,12 @@ export default class Core {
const coreUtils = new CoreUtils(this.ctx)
if (areaSeries.series.length > 0) {
elGraph.push(
...coreUtils.drawSeriesByGroup(areaSeries, gl.areaGroups, 'area', line)
...coreUtils.drawSeriesByGroup(
areaSeries,
gl.areaGroups,
'area',
line
)
)
}
if (columnSeries.series.length > 0) {
Expand All @@ -315,7 +318,12 @@ export default class Core {
}
if (lineSeries.series.length > 0) {
elGraph.push(
...coreUtils.drawSeriesByGroup(lineSeries, gl.lineGroups, 'line', line)
...coreUtils.drawSeriesByGroup(
lineSeries,
gl.lineGroups,
'line',
line
)
)
}
if (candlestickSeries.series.length > 0) {
Expand Down Expand Up @@ -417,6 +425,9 @@ export default class Core {
let gl = this.w.globals
let cnf = this.w.config

if (!cnf.chart.width) cnf.chart.width = '100%'
if (!cnf.chart.height) cnf.chart.height = 'auto'

gl.svgWidth = cnf.chart.width
gl.svgHeight = cnf.chart.height

Expand All @@ -439,7 +450,7 @@ export default class Core {
gl.svgWidth = parseInt(cnf.chart.width, 10)
}

let heightUnit = cnf.chart.height
let heightUnit = String(cnf.chart.height)
.toString()
.split(/[0-9]+/g)
.pop()
Expand Down Expand Up @@ -656,9 +667,9 @@ export default class Core {
// if user has not defined a custom function for selection - we handle the brush chart
// otherwise we leave it to the user to define the functionality for selection
if (typeof w.config.chart.events.selection !== 'function') {
let targets = Array.isArray(w.config.chart.brush.targets) ? w.config.chart.brush.targets : [
w.config.chart.brush.target,
]
let targets = Array.isArray(w.config.chart.brush.targets)
? w.config.chart.brush.targets
: [w.config.chart.brush.target]
// retro compatibility with single target option
targets.forEach((target) => {
let targetChart = ApexCharts.getChartByID(target)
Expand All @@ -685,7 +696,7 @@ export default class Core {
xaxis: {
min: e.xaxis.min,
max: e.xaxis.max,
}
},
},
false,
false,
Expand Down

0 comments on commit b586399

Please sign in to comment.