apexcharts
Advanced tools
Comparing version 3.45.1 to 3.45.2
@@ -43,5 +43,5 @@ { | ||
"toolbar": { | ||
"exportToSVG": "Baixar SVG", | ||
"exportToPNG": "Baixar PNG", | ||
"exportToCSV": "Baixar CSV", | ||
"exportToSVG": "Transferir SVG", | ||
"exportToPNG": "Transferir PNG", | ||
"exportToCSV": "Transferir CSV", | ||
"menu": "Menu", | ||
@@ -48,0 +48,0 @@ "selection": "Selecionar", |
{ | ||
"name": "apexcharts", | ||
"version": "3.45.1", | ||
"version": "3.45.2", | ||
"description": "A JavaScript Chart Library", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -38,3 +38,2 @@ import BarDataLabels from './common/bar/DataLabels' | ||
this.xRatio = xyRatios.xRatio | ||
this.initialXRatio = xyRatios.initialXRatio | ||
this.yRatio = xyRatios.yRatio | ||
@@ -41,0 +40,0 @@ this.invertedXRatio = xyRatios.invertedXRatio |
@@ -107,5 +107,3 @@ import Fill from '../../../modules/Fill' | ||
let xRatio = this.barCtx.xRatio | ||
if (w.config.xaxis.convertedCatToNumeric) { | ||
xRatio = this.barCtx.initialXRatio | ||
} | ||
if ( | ||
@@ -249,3 +247,6 @@ w.globals.minXDiff && | ||
if (!this.barCtx.series[i][j]) { | ||
if ( | ||
typeof this.barCtx.series[i][j] === 'undefined' || | ||
this.barCtx.series[i][j] === null | ||
) { | ||
this.barCtx.isNullValue = true | ||
@@ -252,0 +253,0 @@ } else { |
@@ -86,3 +86,6 @@ import CoreUtils from '../modules/CoreUtils' | ||
let prevX = x | ||
let pX = x | ||
let pY | ||
let pY2 | ||
let prevX = pX | ||
let prevY = this.zeroY | ||
@@ -100,3 +103,3 @@ let prevY2 = this.zeroY | ||
prevY = firstPrevY.prevY | ||
if (w.config.stroke.curve === 'smooth' && series[i][0] === null) { | ||
if (w.config.stroke.curve === 'monotonCubic' && series[i][0] === null) { | ||
// we have to discard the y position if 1st dataPoint is null as it causes issues with monotoneCubic path creation | ||
@@ -107,2 +110,3 @@ yArrj.push(null) | ||
} | ||
pY = prevY | ||
@@ -120,2 +124,3 @@ // y2 are needed for range-area charts | ||
prevY2 = firstPrevY2.prevY | ||
pY2 = prevY2 | ||
y2Arrj.push(prevY2) | ||
@@ -141,2 +146,4 @@ } | ||
y, | ||
pX, | ||
pY, | ||
pathsFrom, | ||
@@ -170,2 +177,3 @@ linePaths, | ||
series: seriesRangeEnd, | ||
pY: pY2, | ||
pathsFrom: pathsFrom2, | ||
@@ -482,2 +490,4 @@ iterations: seriesRangeEnd[i].length - 1, | ||
y, | ||
pX, | ||
pY, | ||
pathsFrom, | ||
@@ -611,2 +621,4 @@ linePaths, | ||
y2Arrj, | ||
pX, | ||
pY, | ||
linePath, | ||
@@ -622,2 +634,4 @@ areaPath, | ||
linePaths = calculatedPaths.linePaths | ||
pX = calculatedPaths.pX | ||
pY = calculatedPaths.pY | ||
areaPath = calculatedPaths.areaPath | ||
@@ -628,3 +642,3 @@ linePath = calculatedPaths.linePath | ||
this.appendPathFrom && | ||
!(w.config.stroke.curve === 'smooth' && type === 'rangeArea') | ||
!(w.config.stroke.curve === 'monotoneCubic' && type === 'rangeArea') | ||
) { | ||
@@ -710,2 +724,4 @@ pathFromLine = pathFromLine + graphics.line(x, this.zeroY) | ||
y2Arrj, | ||
pX, | ||
pY, | ||
linePath, | ||
@@ -735,3 +751,3 @@ areaPath, | ||
(w.globals.hasNullValues || w.config.forecastDataPoints.count > 0) && | ||
curve === 'smooth' | ||
curve === 'monotoneCubic' | ||
) { | ||
@@ -741,3 +757,3 @@ curve = 'straight' | ||
if (curve === 'smooth') { | ||
if (curve === 'monotoneCubic') { | ||
const shouldRenderMonotone = | ||
@@ -757,3 +773,3 @@ type === 'rangeArea' | ||
linePath += svgPath(points, w.globals.gridWidth) | ||
linePath += svgPath(points) | ||
if (series[i][0] === null) { | ||
@@ -764,3 +780,3 @@ // if the first dataPoint is null, we use the linePath directly | ||
// else, we append the areaPath | ||
areaPath += svgPath(points, w.globals.gridWidth) | ||
areaPath += svgPath(points) | ||
} | ||
@@ -783,3 +799,3 @@ | ||
linePath += svgPath(pointsY2, w.globals.gridWidth) | ||
linePath += svgPath(pointsY2) | ||
@@ -802,2 +818,55 @@ // in range area, we don't have separate line and area path | ||
} | ||
} else if (curve === 'smooth') { | ||
let length = (x - pX) * 0.35 | ||
if (w.globals.hasNullValues) { | ||
if (series[i][j] !== null) { | ||
if (series[i][j + 1] !== null) { | ||
linePath = | ||
graphics.move(pX, pY) + | ||
graphics.curve(pX + length, pY, x - length, y, x + 1, y) | ||
areaPath = | ||
graphics.move(pX + 1, pY) + | ||
graphics.curve(pX + length, pY, x - length, y, x + 1, y) + | ||
graphics.line(x, areaBottomY) + | ||
graphics.line(pX, areaBottomY) + | ||
'z' | ||
} else { | ||
linePath = graphics.move(pX, pY) | ||
areaPath = graphics.move(pX, pY) + 'z' | ||
} | ||
} | ||
linePaths.push(linePath) | ||
areaPaths.push(areaPath) | ||
} else { | ||
linePath = | ||
linePath + graphics.curve(pX + length, pY, x - length, y, x, y) | ||
areaPath = | ||
areaPath + graphics.curve(pX + length, pY, x - length, y, x, y) | ||
} | ||
pX = x | ||
pY = y | ||
if (j === series[i].length - 2) { | ||
// last loop, close path | ||
areaPath = | ||
areaPath + | ||
graphics.curve(pX, pY, x, y, x, areaBottomY) + | ||
graphics.move(x, y) + | ||
'z' | ||
if (type === 'rangeArea' && isRangeStart) { | ||
linePath = | ||
linePath + | ||
graphics.curve(pX, pY, x, y, x, y2) + | ||
graphics.move(x, y2) + | ||
'z' | ||
} else { | ||
if (!w.globals.hasNullValues) { | ||
linePaths.push(linePath) | ||
areaPaths.push(areaPath) | ||
} | ||
} | ||
} | ||
} else { | ||
@@ -849,2 +918,4 @@ if (series[i][j + 1] === null) { | ||
areaPaths, | ||
pX, | ||
pY, | ||
linePath, | ||
@@ -851,0 +922,0 @@ areaPath, |
@@ -89,3 +89,3 @@ import '../libs/Treemap-squared' | ||
y2 - y1, | ||
0, | ||
w.config.plotOptions.treemap.borderRadius, | ||
'#fff', | ||
@@ -92,0 +92,0 @@ 1, |
@@ -72,3 +72,3 @@ /** | ||
*/ | ||
export const svgPath = (points, chartWidth) => { | ||
export const svgPath = (points) => { | ||
let p = '' | ||
@@ -78,19 +78,11 @@ | ||
const point = points[i] | ||
const prevPoint = points[i - 1] | ||
const n = point.length | ||
const pn = prevPoint?.length | ||
if (i > 1 && Math.abs(point[n - 2] - prevPoint[pn - 2]) < chartWidth / 25) { | ||
// fallback to straight line if the x distance is too small | ||
// or if the curve goes backward too much | ||
p += `L${point[2]}, ${point[3]}` | ||
} else { | ||
if (n > 4) { | ||
p += `C${point[0]}, ${point[1]}` | ||
p += `, ${point[2]}, ${point[3]}` | ||
p += `, ${point[4]}, ${point[5]}` | ||
} else if (n > 2) { | ||
p += `S${point[0]}, ${point[1]}` | ||
p += `, ${point[2]}, ${point[3]}` | ||
} | ||
if (n > 4) { | ||
p += `C${point[0]}, ${point[1]}` | ||
p += `, ${point[2]}, ${point[3]}` | ||
p += `, ${point[4]}, ${point[5]}` | ||
} else if (n > 2) { | ||
p += `S${point[0]}, ${point[1]}` | ||
p += `, ${point[2]}, ${point[3]}` | ||
} | ||
@@ -97,0 +89,0 @@ } |
@@ -43,5 +43,5 @@ { | ||
"toolbar": { | ||
"exportToSVG": "Baixar SVG", | ||
"exportToPNG": "Baixar PNG", | ||
"exportToCSV": "Baixar CSV", | ||
"exportToSVG": "Transferir SVG", | ||
"exportToPNG": "Transferir PNG", | ||
"exportToCSV": "Transferir CSV", | ||
"menu": "Menu", | ||
@@ -48,0 +48,0 @@ "selection": "Selecionar", |
@@ -615,3 +615,3 @@ import Bar from '../charts/Bar' | ||
if (typeof w.config.chart.events.selection !== 'function') { | ||
let targets = Array.isArray(w.config.chart.brush.targets) || [ | ||
let targets = Array.isArray(w.config.chart.brush.targets) ? w.config.chart.brush.targets : [ | ||
w.config.chart.brush.target, | ||
@@ -618,0 +618,0 @@ ] |
@@ -257,3 +257,2 @@ /* | ||
let xRatio = 0 | ||
let initialXRatio = 0 | ||
let invertedXRatio = 0 | ||
@@ -284,4 +283,2 @@ let zRatio = 0 | ||
initialXRatio = Math.abs(gl.initialMaxX - gl.initialMinX) / gl.gridWidth | ||
invertedYRatio = gl.yRange / gl.gridWidth | ||
@@ -321,3 +318,2 @@ invertedXRatio = gl.xRange / gl.gridHeight | ||
xRatio, | ||
initialXRatio, | ||
invertedXRatio, | ||
@@ -324,0 +320,0 @@ baseLineInvertedY, |
@@ -18,59 +18,58 @@ import Graphics from '../Graphics' | ||
const text = ` | ||
.apexcharts-legend { | ||
display: flex; | ||
overflow: auto; | ||
padding: 0 10px; | ||
} | ||
.apexcharts-legend.apx-legend-position-bottom, .apexcharts-legend.apx-legend-position-top { | ||
flex-wrap: wrap | ||
} | ||
.apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left { | ||
flex-direction: column; | ||
bottom: 0; | ||
} | ||
.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-left, .apexcharts-legend.apx-legend-position-top.apexcharts-align-left, .apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left { | ||
justify-content: flex-start; | ||
} | ||
.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center, .apexcharts-legend.apx-legend-position-top.apexcharts-align-center { | ||
justify-content: center; | ||
} | ||
.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right, .apexcharts-legend.apx-legend-position-top.apexcharts-align-right { | ||
justify-content: flex-end; | ||
} | ||
.apexcharts-legend-series { | ||
cursor: pointer; | ||
line-height: normal; | ||
} | ||
.apexcharts-legend.apx-legend-position-bottom .apexcharts-legend-series, .apexcharts-legend.apx-legend-position-top .apexcharts-legend-series{ | ||
display: flex; | ||
align-items: center; | ||
} | ||
.apexcharts-legend-text { | ||
position: relative; | ||
font-size: 14px; | ||
} | ||
.apexcharts-legend-text *, .apexcharts-legend-marker * { | ||
pointer-events: none; | ||
} | ||
.apexcharts-legend-marker { | ||
position: relative; | ||
display: inline-block; | ||
cursor: pointer; | ||
margin-right: 3px; | ||
const text = ` | ||
.apexcharts-legend { | ||
display: flex; | ||
overflow: auto; | ||
padding: 0 10px; | ||
} | ||
.apexcharts-legend.apx-legend-position-bottom, .apexcharts-legend.apx-legend-position-top { | ||
flex-wrap: wrap | ||
} | ||
.apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left { | ||
flex-direction: column; | ||
bottom: 0; | ||
} | ||
.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-left, .apexcharts-legend.apx-legend-position-top.apexcharts-align-left, .apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left { | ||
justify-content: flex-start; | ||
} | ||
.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center, .apexcharts-legend.apx-legend-position-top.apexcharts-align-center { | ||
justify-content: center; | ||
} | ||
.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right, .apexcharts-legend.apx-legend-position-top.apexcharts-align-right { | ||
justify-content: flex-end; | ||
} | ||
.apexcharts-legend-series { | ||
cursor: pointer; | ||
line-height: normal; | ||
} | ||
.apexcharts-legend.apx-legend-position-bottom .apexcharts-legend-series, .apexcharts-legend.apx-legend-position-top .apexcharts-legend-series{ | ||
display: flex; | ||
align-items: center; | ||
} | ||
.apexcharts-legend-text { | ||
position: relative; | ||
font-size: 14px; | ||
} | ||
.apexcharts-legend-text *, .apexcharts-legend-marker * { | ||
pointer-events: none; | ||
} | ||
.apexcharts-legend-marker { | ||
position: relative; | ||
display: inline-block; | ||
cursor: pointer; | ||
margin-right: 3px; | ||
border-style: solid; | ||
} | ||
.apexcharts-legend.apexcharts-align-right .apexcharts-legend-series, .apexcharts-legend.apexcharts-align-left .apexcharts-legend-series{ | ||
display: inline-block; | ||
} | ||
.apexcharts-legend-series.apexcharts-no-click { | ||
cursor: auto; | ||
} | ||
.apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series { | ||
display: none !important; | ||
} | ||
.apexcharts-inactive-legend { | ||
opacity: 0.45; | ||
} | ||
.apexcharts-legend.apexcharts-align-right .apexcharts-legend-series, .apexcharts-legend.apexcharts-align-left .apexcharts-legend-series{ | ||
display: inline-block; | ||
} | ||
.apexcharts-legend-series.apexcharts-no-click { | ||
cursor: auto; | ||
} | ||
.apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series { | ||
display: none !important; | ||
} | ||
.apexcharts-inactive-legend { | ||
opacity: 0.45; | ||
}` | ||
@@ -77,0 +76,0 @@ |
@@ -74,6 +74,2 @@ import Defaults from './Defaults' | ||
if (opts?.stroke?.curve === 'monotoneCubic') { | ||
opts.stroke.curve = 'smooth' | ||
} | ||
// If user has specified a dark theme, make the tooltip dark too | ||
@@ -80,0 +76,0 @@ this.checkForDarkTheme(window.Apex) // check global window Apex options |
@@ -488,2 +488,3 @@ /** | ||
useFillColorAsStroke: false, | ||
borderRadius: 4, | ||
dataLabels: { | ||
@@ -944,3 +945,3 @@ format: 'scale', // scale | truncate | ||
shared: true, | ||
hideEmptySeries: true, | ||
hideEmptySeries: false, | ||
followCursor: false, // when disabled, the tooltip will show on top of the series instead of mouse position | ||
@@ -947,0 +948,0 @@ intersect: false, // when enabled, tooltip will only show when user directly hovers over point |
@@ -499,5 +499,5 @@ // Typescript declarations for Apex class and module. | ||
reset?: string | ||
exportToSVG?: string | ||
exportToPNG?: string | ||
exportToCSV?: string | ||
exportToSVG?: string | ||
exportToPNG?: string | ||
exportToCSV?: string | ||
} | ||
@@ -606,2 +606,3 @@ } | ||
dataLabels?: { format?: 'scale' | 'truncate' } | ||
borderRadius?: number | ||
colorScale?: { | ||
@@ -608,0 +609,0 @@ inverse?: boolean |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4446712
71735