Skip to content

Commit

Permalink
radar fix #4371
Browse files Browse the repository at this point in the history
  • Loading branch information
junedchhipa committed Apr 8, 2024
1 parent aac9485 commit 3c438a3
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions src/charts/Radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ class Radar {

let ret = this.graphics.group({
class: 'apexcharts-radar-series apexcharts-plot-series',
transform: `translate(${translateX || 0}, ${translateY || 0})`
transform: `translate(${translateX || 0}, ${translateY || 0})`,
})

let dataPointsPos = []
let elPointsMain = null
let elDataPointsMain = null

this.yaxisLabels = this.graphics.group({
class: 'apexcharts-yaxis'
class: 'apexcharts-yaxis',
})

series.forEach((s, i) => {
Expand All @@ -111,7 +111,7 @@ class Radar {
'data:longestSeries': longestSeries,
seriesName: Utils.escapeString(w.globals.seriesNames[i]),
rel: i + 1,
'data:realIndex': i
'data:realIndex': i,
})

this.dataRadiusOfPercent[i] = []
Expand All @@ -120,7 +120,7 @@ class Radar {

s.forEach((dv, j) => {
const range = Math.abs(this.maxValue - this.minValue)
dv = dv + Math.abs(this.minValue)
dv = dv - this.minValue

if (this.isLog) {
dv = this.coreUtils.getLogVal(this.logBase, dv, 0)
Expand All @@ -138,23 +138,23 @@ class Radar {
)
const paths = this.createPaths(dataPointsPos, {
x: 0,
y: 0
y: 0,
})

// points
elPointsMain = this.graphics.group({
class: 'apexcharts-series-markers-wrap apexcharts-element-hidden'
class: 'apexcharts-series-markers-wrap apexcharts-element-hidden',
})

// datapoints
elDataPointsMain = this.graphics.group({
class: `apexcharts-datalabels`,
'data:realIndex': i
'data:realIndex': i,
})

w.globals.delayedElements.push({
el: elPointsMain.node,
index: i
index: i,
})

const defaultRenderedPathOptions = {
Expand All @@ -167,7 +167,7 @@ class Radar {
shouldClipToGrid: false,
bindEventsOnPaths: false,
stroke: w.globals.stroke.colors[i],
strokeLineCap: w.config.stroke.lineCap
strokeLineCap: w.config.stroke.lineCap,
}

let pathFrom = null
Expand All @@ -185,13 +185,13 @@ class Radar {
? this.strokeWidth[i]
: this.strokeWidth,
fill: 'none',
drawShadow: false
drawShadow: false,
})

elSeries.add(renderedLinePath)

let pathFill = fill.fillPath({
seriesNumber: i
seriesNumber: i,
})

let renderedAreaPath = this.graphics.renderPaths({
Expand All @@ -200,7 +200,7 @@ class Radar {
pathTo: paths.areaPathsTo[p],
strokeWidth: 0,
fill: pathFill,
drawShadow: false
drawShadow: false,
})

if (w.config.chart.dropShadow.enabled) {
Expand All @@ -223,7 +223,7 @@ class Radar {
let opts = markers.getMarkerConfig({
cssClass: 'apexcharts-marker',
seriesIndex: i,
dataPointIndex: j
dataPointIndex: j,
})

let point = this.graphics.drawMarker(
Expand All @@ -238,7 +238,7 @@ class Radar {
point.node.setAttribute('default-marker-size', opts.pSize)

let elPointsWrap = this.graphics.group({
class: 'apexcharts-series-markers'
class: 'apexcharts-series-markers',
})

if (elPointsWrap) {
Expand All @@ -255,7 +255,7 @@ class Radar {
let text = dataLabelsConfig.formatter(w.globals.series[i][j], {
seriesIndex: i,
dataPointIndex: j,
w
w,
})

dataLabels.plotDataLabelsText({
Expand All @@ -268,8 +268,8 @@ class Radar {
parent: elDataPointsMain,
offsetCorrection: false,
dataLabelsConfig: {
...dataLabelsConfig
}
...dataLabelsConfig,
},
})
}
elSeries.add(elDataPointsMain)
Expand All @@ -279,7 +279,7 @@ class Radar {
})

this.drawPolygons({
parent: ret
parent: ret,
})

if (w.config.xaxis.labels.show) {
Expand Down Expand Up @@ -336,7 +336,7 @@ class Radar {
if (i === 0) {
this.yaxisLabelsTextsPos.push({
x: p.x,
y: p.y
y: p.y,
})
}

Expand Down Expand Up @@ -375,7 +375,7 @@ class Radar {

const xaxisLabelsConfig = w.config.xaxis.labels
let elXAxisWrap = this.graphics.group({
class: 'apexcharts-xaxis'
class: 'apexcharts-xaxis',
})

let polygonPos = Utils.getPolygonPos(this.size, this.dataPointsLen)
Expand All @@ -390,7 +390,7 @@ class Radar {
let text = formatter(label, {
seriesIndex: -1,
dataPointIndex: i,
w
w,
})

dataLabels.plotDataLabelsText({
Expand All @@ -409,9 +409,9 @@ class Radar {
dataLabelsConfig: {
textAnchor: textPos.textAnchor,
dropShadow: { enabled: false },
...xaxisLabelsConfig
...xaxisLabelsConfig,
},
offsetCorrection: false
offsetCorrection: false,
})
}
})
Expand Down Expand Up @@ -449,7 +449,7 @@ class Radar {
linePathsFrom,
linePathsTo,
areaPathsFrom,
areaPathsTo
areaPathsTo,
}
}

Expand Down Expand Up @@ -482,7 +482,7 @@ class Radar {
return {
textAnchor,
newX,
newY
newY,
}
}

Expand Down

0 comments on commit 3c438a3

Please sign in to comment.