Skip to content

Commit

Permalink
Merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian-Webster committed Jul 24, 2024
2 parents 31b69d3 + ad63c82 commit c153052
Show file tree
Hide file tree
Showing 137 changed files with 311 additions and 330 deletions.
2 changes: 1 addition & 1 deletion dist/apexcharts.amd.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/apexcharts.common.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/apexcharts.css
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ rect.legend-mouseover-inactive,
.apexcharts-line,
.apexcharts-line-series .apexcharts-series-markers .apexcharts-marker.no-pointer-events,
.apexcharts-point-annotation-label,
.apexcharts-radar-series path,
.apexcharts-radar-series path:not(.apexcharts-marker),
.apexcharts-radar-series polygon,
.apexcharts-toolbar svg,
.apexcharts-tooltip .apexcharts-marker,
Expand All @@ -640,7 +640,7 @@ rect.legend-mouseover-inactive,
pointer-events: none
}

.apexcharts-marker {
.apexcharts-tooltip-active .apexcharts-marker {
transition: .15s ease all
}

Expand Down
6 changes: 3 additions & 3 deletions dist/apexcharts.esm.js

Large diffs are not rendered by default.

489 changes: 240 additions & 249 deletions dist/apexcharts.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/apexcharts.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apexcharts",
"version": "3.50.0",
"version": "3.51.0",
"description": "A JavaScript Chart Library",
"repository": {
"type": "git",
Expand Down
20 changes: 10 additions & 10 deletions src/charts/common/bar/DataLabels.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default class BarDataLabels {
height: 0,
}
if (w.config.dataLabels.enabled) {
const yLabel = this.barCtx.series[i][j]
const yLabel = w.globals.series[i][j]

textRects = graphics.getTextRects(
w.globals.yLabelFormatters[0](yLabel),
Expand Down Expand Up @@ -127,15 +127,15 @@ export default class BarDataLabels {
cy: dataLabelsPos.bcy,
cx: dataLabelsPos.bcx,
j,
val: series[i][j],
val: w.globals.series[i][j],
barHeight,
barWidth,
})

dataLabels = this.drawCalculatedDataLabels({
x: dataLabelsPos.dataLabelsX,
y: dataLabelsPos.dataLabelsY,
val: this.barCtx.isRangeBar ? [y1, y2] : series[i][j],
val: this.barCtx.isRangeBar ? [y1, y2] : w.globals.series[i][j],
i: realIndex,
j,
barWidth,
Expand Down Expand Up @@ -242,7 +242,7 @@ export default class BarDataLabels {
dataLabelsX + textRects.height / 2 - strokeWidth / 2 - offsetDLX
}

let valIsNegative = this.barCtx.series[i][j] < 0
let valIsNegative = w.globals.series[i][j] < 0

let newY = y
if (this.barCtx.isReversed) {
Expand Down Expand Up @@ -332,11 +332,11 @@ export default class BarDataLabels {

totalDataLabelsX =
totalDataLabelsBcx +
(w.globals.isXNumeric
? -barWidth * w.globals.barGroups.length / 2
: w.globals.barGroups.length * barWidth / 2
- (w.globals.barGroups.length - 1) * barWidth
- xDivision) +
(w.globals.isXNumeric
? (-barWidth * w.globals.barGroups.length) / 2
: (w.globals.barGroups.length * barWidth) / 2 -
(w.globals.barGroups.length - 1) * barWidth -
xDivision) +
barTotalDataLabelsConfig.offsetX
}

Expand Down Expand Up @@ -396,7 +396,7 @@ export default class BarDataLabels {
let totalDataLabelsY
let totalDataLabelsAnchor = 'start'

let valIsNegative = this.barCtx.series[i][j] < 0
let valIsNegative = w.globals.series[i][j] < 0

let newX = x
if (this.barCtx.isReversed) {
Expand Down
4 changes: 2 additions & 2 deletions src/charts/common/bar/Helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export default class Helpers {
})
}

if (w.config.series[i].data[j] && w.config.series[i].data[j].fillColor) {
if (w.config.series[i].data[j]?.fillColor) {
fillColor = w.config.series[i].data[j].fillColor
}

Expand All @@ -214,7 +214,7 @@ export default class Helpers {
fillType: w.config.series[i].data[j]?.fill?.type
? w.config.series[i].data[j]?.fill.type
: Array.isArray(w.config.fill.type)
? w.config.fill.type[i]
? w.config.fill.type[realIndex]
: w.config.fill.type,
})

Expand Down
2 changes: 1 addition & 1 deletion src/modules/Core.js
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ export default class Core {
!w.config.legend.floating
) {
legendHeight =
new Legend(this.ctx).legendHelpers.getLegendBBox().clwh + 10
new Legend(this.ctx).legendHelpers.getLegendDimensions().clwh + 10
}

let el = w.globals.dom.baseEl.querySelector(
Expand Down
63 changes: 29 additions & 34 deletions src/modules/Range.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,37 +36,6 @@ class Range {
if (endingSeriesIndex === null) {
endingSeriesIndex = startingSeriesIndex + 1
}

let firstXIndex = 0
let lastXIndex = 0
let seriesX = undefined
if (gl.seriesX.length >= endingSeriesIndex) {
seriesX = [...new Set([].concat(...gl.seriesX.slice(startingSeriesIndex, endingSeriesIndex)))]
firstXIndex = 0
lastXIndex = seriesX.length - 1
// Eventually brushSource will be set if the current chart is a target.
// That is, after the appropriate event causes us to update.
let brush = gl.brushSource?.w.config.chart.brush
if ((cnf.chart.zoom.enabled && cnf.chart.zoom.autoScaleYaxis)
|| (brush?.enabled && brush?.autoScaleYaxis)
) {
// Scale the Y axis to the min..max within the zoomed X axis domain.
if (cnf.xaxis.min) {
for (
firstXIndex = 0;
firstXIndex < lastXIndex && seriesX[firstXIndex] < cnf.xaxis.min;
firstXIndex++
) {}
}
if (cnf.xaxis.max) {
for (
;
lastXIndex > firstXIndex && seriesX[lastXIndex] > cnf.xaxis.max;
lastXIndex--
) {}
}
}
}

let series = gl.series
let seriesMin = series
Expand All @@ -82,6 +51,17 @@ class Range {
seriesMin = gl.seriesRangeStart
seriesMax = gl.seriesRangeEnd
}
let autoScaleYaxis = false
if (gl.seriesX.length >= endingSeriesIndex) {
// Eventually brushSource will be set if the current chart is a target.
// That is, after the appropriate event causes us to update.
let brush = gl.brushSource?.w.config.chart.brush
if ((cnf.chart.zoom.enabled && cnf.chart.zoom.autoScaleYaxis)
|| (brush?.enabled && brush?.autoScaleYaxis)
) {
autoScaleYaxis = true
}
}

for (let i = startingSeriesIndex; i < endingSeriesIndex; i++) {
gl.dataPoints = Math.max(gl.dataPoints, series[i].length)
Expand All @@ -102,9 +82,24 @@ class Range {
// the condition cnf.xaxis.type !== 'datetime' fixes #3897 and #3905
gl.dataPoints = Math.max(gl.dataPoints, gl.labels.length)
}
if (!seriesX) {
firstXIndex = 0
lastXIndex = gl.series[i].length
let firstXIndex = 0
let lastXIndex = series[i].length - 1
if (autoScaleYaxis) {
// Scale the Y axis to the min..max within the possibly zoomed X axis domain.
if (cnf.xaxis.min) {
for (
;
firstXIndex < lastXIndex && gl.seriesX[i][firstXIndex] < cnf.xaxis.min;
firstXIndex++
) {}
}
if (cnf.xaxis.max) {
for (
;
lastXIndex > firstXIndex && gl.seriesX[i][lastXIndex] > cnf.xaxis.max;
lastXIndex--
) {}
}
}
for (let j = firstXIndex; j <= lastXIndex && j < gl.series[i].length; j++) {
let val = series[i][j]
Expand Down
18 changes: 8 additions & 10 deletions src/modules/ZoomPanSelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -559,16 +559,14 @@ export default class ZoomPanSelection extends Toolbar {

w.config.yaxis.forEach((yaxe, index) => {
// We can use the index of any series referenced by the Yaxis
// because they will all return the same value.
if (w.globals.seriesYAxisMap[index].length > 0) {
let seriesIndex = w.globals.seriesYAxisMap[index][0]
yHighestValue.push(
w.globals.yAxisScale[index].niceMax - xyRatios.yRatio[seriesIndex] * me.startY
)
yLowestValue.push(
w.globals.yAxisScale[index].niceMax - xyRatios.yRatio[seriesIndex] * me.endY
)
}
// because they will all return the same value, so we choose the first.
let seriesIndex = w.globals.seriesYAxisMap[index][0]
yHighestValue.push(
w.globals.yAxisScale[index].niceMax - xyRatios.yRatio[seriesIndex] * me.startY
)
yLowestValue.push(
w.globals.yAxisScale[index].niceMax - xyRatios.yRatio[seriesIndex] * me.endY
)
})

if (
Expand Down
8 changes: 3 additions & 5 deletions src/modules/legend/Helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,12 @@ export default class Helpers {
return stylesheet
}

getLegendBBox() {
getLegendDimensions() {
const w = this.w
let currLegendsWrap =
w.globals.dom.baseEl.querySelector('.apexcharts-legend')
let currLegendsWrapRect = currLegendsWrap.getBoundingClientRect()

let currLegendsWrapWidth = currLegendsWrapRect.width
let currLegendsWrapHeight = currLegendsWrapRect.height
let currLegendsWrapWidth = currLegendsWrap.offsetWidth
let currLegendsWrapHeight = currLegendsWrap.offsetHeight

return {
clwh: currLegendsWrapHeight,
Expand Down
7 changes: 3 additions & 4 deletions src/modules/legend/Legend.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,9 @@ class Legend {
const SVGMarker = SVG(elMarker).size('100%', '100%')
const marker = new Graphics(this.ctx).drawMarker(0, 0, {
...markerConfig,
pointFillColor: Array.isArray(w.config.legend.markers.fillColors)
pointFillColor: Array.isArray(fillcolor)
? fillcolor[i]
: markerConfig.pointFillColor,

shape,
})

Expand Down Expand Up @@ -374,7 +373,7 @@ class Legend {

elLegendWrap.style.right = 0

let lRect = this.legendHelpers.getLegendBBox()
let lRect = this.legendHelpers.getLegendDimensions()

let dimensions = new Dimensions(this.ctx)
let titleRect = dimensions.dimHelpers.getTitleSubtitleCoords('title')
Expand All @@ -401,7 +400,7 @@ class Legend {
legendAlignVertical() {
let w = this.w

let lRect = this.legendHelpers.getLegendBBox()
let lRect = this.legendHelpers.getLegendDimensions()

let offsetY = 20
let offsetX = 0
Expand Down
Binary file modified tests/e2e/snapshots/area/area-datetime.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/snapshots/area/area-github-style.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/snapshots/area/area-spline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/snapshots/area/area-with-missing-data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/snapshots/area/area-with-negative.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/snapshots/area/basic-area.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/snapshots/area/multi-axis-with-seriesname-arrays.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/snapshots/area/stacked-area.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/snapshots/area/timeseries-with-irregular-data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/snapshots/bar/bar-with-custom-data-labels.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/snapshots/bar/bar-with-images.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/snapshots/bar/bar-with-markers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/snapshots/bar/bar-with-negative.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/snapshots/bar/basic-bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/snapshots/bar/grouped-bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/snapshots/bar/grouped-stacked-bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/snapshots/bar/patterned-bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/snapshots/bar/reversed-bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/snapshots/bar/stacked-bar-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/snapshots/bar/stacked-bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/snapshots/boxPlot/basic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/snapshots/boxPlot/boxplot-scatter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/snapshots/boxPlot/horizontal-boxplot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/snapshots/bubble/3d-bubble.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/snapshots/bubble/simple-bubble.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/snapshots/candlestick/basic.png
Binary file modified tests/e2e/snapshots/candlestick/candlestick-bar.png
Binary file modified tests/e2e/snapshots/candlestick/candlestick-category.png
Binary file modified tests/e2e/snapshots/candlestick/candlestick-line.png
Binary file modified tests/e2e/snapshots/column/basic-column.png
Binary file modified tests/e2e/snapshots/column/column-with-data-labels.png
Binary file modified tests/e2e/snapshots/column/column-with-group-label.png
Binary file modified tests/e2e/snapshots/column/column-with-markers.png
Binary file modified tests/e2e/snapshots/column/column-with-negative.png
Binary file modified tests/e2e/snapshots/column/column-with-rotated-data-labels.png
Binary file modified tests/e2e/snapshots/column/column-with-rotated-labels.png
Binary file modified tests/e2e/snapshots/column/data-color.png
Binary file modified tests/e2e/snapshots/column/distributed-columns.png
Binary file modified tests/e2e/snapshots/column/dumbbell-chart.png
Binary file modified tests/e2e/snapshots/column/dynamic-loaded-chart.png
Binary file modified tests/e2e/snapshots/column/grouped-stacked-column.png
Binary file modified tests/e2e/snapshots/column/range-column.png
Binary file modified tests/e2e/snapshots/column/stacked-column-100.png
Binary file modified tests/e2e/snapshots/column/stacked-column-with-line-new.png
Binary file modified tests/e2e/snapshots/column/stacked-column-with-line.png
Binary file modified tests/e2e/snapshots/column/stacked-column.png
Binary file modified tests/e2e/snapshots/funnel/funnel.png
Binary file modified tests/e2e/snapshots/funnel/pyramid.png
Binary file modified tests/e2e/snapshots/heatmap/basic.png
Binary file modified tests/e2e/snapshots/heatmap/color-range.png
Binary file modified tests/e2e/snapshots/heatmap/image-fill.png
Binary file modified tests/e2e/snapshots/heatmap/multiple-color-scales-flipped.png
Binary file modified tests/e2e/snapshots/heatmap/multiple-color.png
Binary file modified tests/e2e/snapshots/heatmap/rounded.png
Binary file modified tests/e2e/snapshots/line/basic-line.png
Binary file modified tests/e2e/snapshots/line/brush-charts.png
Binary file modified tests/e2e/snapshots/line/dashed-line.png
Binary file modified tests/e2e/snapshots/line/gradient-line.png
Binary file modified tests/e2e/snapshots/line/line-with-annotations.png
Binary file modified tests/e2e/snapshots/line/line-with-data-labels.png
Binary file modified tests/e2e/snapshots/line/line-with-image.png
Binary file modified tests/e2e/snapshots/line/line-with-missing-data.png
Binary file modified tests/e2e/snapshots/line/linestep.png
Binary file modified tests/e2e/snapshots/line/logarithmic-line.png
Binary file modified tests/e2e/snapshots/line/realtime.png
Binary file modified tests/e2e/snapshots/line/stepline.png
Binary file modified tests/e2e/snapshots/line/syncing-charts.png
Binary file modified tests/e2e/snapshots/line/zoomable-timeseries.png
Binary file modified tests/e2e/snapshots/misc/annotations-example.png
Binary file modified tests/e2e/snapshots/misc/axios.png
Binary file modified tests/e2e/snapshots/misc/custom-legend.png
Binary file modified tests/e2e/snapshots/misc/jquery.png
Binary file modified tests/e2e/snapshots/misc/minMaxPoints.png
Binary file modified tests/e2e/snapshots/misc/no-data.png
Binary file modified tests/e2e/snapshots/mixed/duplicate-labels.png
Binary file modified tests/e2e/snapshots/mixed/line-area.png
Binary file modified tests/e2e/snapshots/mixed/line-column-area.png
Binary file modified tests/e2e/snapshots/mixed/line-column.png
Binary file modified tests/e2e/snapshots/mixed/line-scatter.png
Binary file modified tests/e2e/snapshots/mixed/multiple-yaxes.png
Binary file modified tests/e2e/snapshots/pie/donut-update.png
Binary file modified tests/e2e/snapshots/pie/donut-with-pattern.png
Binary file modified tests/e2e/snapshots/pie/gradient-donut.png
Binary file modified tests/e2e/snapshots/pie/monochrome-pie.png
Binary file modified tests/e2e/snapshots/pie/pie-with-image.png
Binary file modified tests/e2e/snapshots/pie/semi-donut.png
Binary file modified tests/e2e/snapshots/pie/simple-donut.png
Binary file modified tests/e2e/snapshots/pie/simple-pie.png
Binary file modified tests/e2e/snapshots/polarArea/basic-polar-area.png
Binary file modified tests/e2e/snapshots/polarArea/polar-area-monochrome.png
Binary file modified tests/e2e/snapshots/radar/basic-radar.png
Binary file modified tests/e2e/snapshots/radar/radar-multiple-series.png
Binary file modified tests/e2e/snapshots/radar/radar-with-polygon-fill.png
Binary file modified tests/e2e/snapshots/radialBar/circle-chart-multiple.png
Binary file modified tests/e2e/snapshots/radialBar/circle-chart-with-image.png
Binary file modified tests/e2e/snapshots/radialBar/circle-chart.png
Binary file modified tests/e2e/snapshots/radialBar/circle-custom-angle.png
Binary file modified tests/e2e/snapshots/radialBar/circle-gradient.png
Binary file modified tests/e2e/snapshots/radialBar/semi-circle-chart.png
Binary file modified tests/e2e/snapshots/radialBar/stroked-gauge.png
Binary file modified tests/e2e/snapshots/rangeArea/basic-range-area.png
Binary file modified tests/e2e/snapshots/rangeArea/range-area-line-combo.png
Binary file modified tests/e2e/snapshots/scatter/scatter-basic.png
Binary file modified tests/e2e/snapshots/scatter/scatter-datetime.png
Binary file modified tests/e2e/snapshots/scatter/scatter-images.png
Binary file modified tests/e2e/snapshots/slope/basic.png
Binary file modified tests/e2e/snapshots/slope/slope-style-2.png
Binary file modified tests/e2e/snapshots/sparklines/sparklines.png
Binary file modified tests/e2e/snapshots/timelines/advanced.png
Binary file modified tests/e2e/snapshots/timelines/brush-rangebars.png
Binary file modified tests/e2e/snapshots/timelines/controlling-colors.png
Binary file modified tests/e2e/snapshots/timelines/dumbbell-chart-horizontal.png
Binary file modified tests/e2e/snapshots/timelines/multi-series-group-rows.png
Binary file modified tests/e2e/snapshots/timelines/multi-series.png
Binary file modified tests/e2e/snapshots/timelines/simple.png
Binary file modified tests/e2e/snapshots/treemap/basic.png
Binary file modified tests/e2e/snapshots/treemap/color-scale.png
Binary file modified tests/e2e/snapshots/treemap/distributed.png
Binary file modified tests/e2e/snapshots/treemap/multi-dimensional.png

0 comments on commit c153052

Please sign in to comment.