Skip to content

Commit 3c438a3

Browse files
committed
radar fix #4371
1 parent aac9485 commit 3c438a3

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

src/charts/Radar.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ class Radar {
9191

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

9797
let dataPointsPos = []
9898
let elPointsMain = null
9999
let elDataPointsMain = null
100100

101101
this.yaxisLabels = this.graphics.group({
102-
class: 'apexcharts-yaxis'
102+
class: 'apexcharts-yaxis',
103103
})
104104

105105
series.forEach((s, i) => {
@@ -111,7 +111,7 @@ class Radar {
111111
'data:longestSeries': longestSeries,
112112
seriesName: Utils.escapeString(w.globals.seriesNames[i]),
113113
rel: i + 1,
114-
'data:realIndex': i
114+
'data:realIndex': i,
115115
})
116116

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

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

125125
if (this.isLog) {
126126
dv = this.coreUtils.getLogVal(this.logBase, dv, 0)
@@ -138,23 +138,23 @@ class Radar {
138138
)
139139
const paths = this.createPaths(dataPointsPos, {
140140
x: 0,
141-
y: 0
141+
y: 0,
142142
})
143143

144144
// points
145145
elPointsMain = this.graphics.group({
146-
class: 'apexcharts-series-markers-wrap apexcharts-element-hidden'
146+
class: 'apexcharts-series-markers-wrap apexcharts-element-hidden',
147147
})
148148

149149
// datapoints
150150
elDataPointsMain = this.graphics.group({
151151
class: `apexcharts-datalabels`,
152-
'data:realIndex': i
152+
'data:realIndex': i,
153153
})
154154

155155
w.globals.delayedElements.push({
156156
el: elPointsMain.node,
157-
index: i
157+
index: i,
158158
})
159159

160160
const defaultRenderedPathOptions = {
@@ -167,7 +167,7 @@ class Radar {
167167
shouldClipToGrid: false,
168168
bindEventsOnPaths: false,
169169
stroke: w.globals.stroke.colors[i],
170-
strokeLineCap: w.config.stroke.lineCap
170+
strokeLineCap: w.config.stroke.lineCap,
171171
}
172172

173173
let pathFrom = null
@@ -185,13 +185,13 @@ class Radar {
185185
? this.strokeWidth[i]
186186
: this.strokeWidth,
187187
fill: 'none',
188-
drawShadow: false
188+
drawShadow: false,
189189
})
190190

191191
elSeries.add(renderedLinePath)
192192

193193
let pathFill = fill.fillPath({
194-
seriesNumber: i
194+
seriesNumber: i,
195195
})
196196

197197
let renderedAreaPath = this.graphics.renderPaths({
@@ -200,7 +200,7 @@ class Radar {
200200
pathTo: paths.areaPathsTo[p],
201201
strokeWidth: 0,
202202
fill: pathFill,
203-
drawShadow: false
203+
drawShadow: false,
204204
})
205205

206206
if (w.config.chart.dropShadow.enabled) {
@@ -223,7 +223,7 @@ class Radar {
223223
let opts = markers.getMarkerConfig({
224224
cssClass: 'apexcharts-marker',
225225
seriesIndex: i,
226-
dataPointIndex: j
226+
dataPointIndex: j,
227227
})
228228

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

240240
let elPointsWrap = this.graphics.group({
241-
class: 'apexcharts-series-markers'
241+
class: 'apexcharts-series-markers',
242242
})
243243

244244
if (elPointsWrap) {
@@ -255,7 +255,7 @@ class Radar {
255255
let text = dataLabelsConfig.formatter(w.globals.series[i][j], {
256256
seriesIndex: i,
257257
dataPointIndex: j,
258-
w
258+
w,
259259
})
260260

261261
dataLabels.plotDataLabelsText({
@@ -268,8 +268,8 @@ class Radar {
268268
parent: elDataPointsMain,
269269
offsetCorrection: false,
270270
dataLabelsConfig: {
271-
...dataLabelsConfig
272-
}
271+
...dataLabelsConfig,
272+
},
273273
})
274274
}
275275
elSeries.add(elDataPointsMain)
@@ -279,7 +279,7 @@ class Radar {
279279
})
280280

281281
this.drawPolygons({
282-
parent: ret
282+
parent: ret,
283283
})
284284

285285
if (w.config.xaxis.labels.show) {
@@ -336,7 +336,7 @@ class Radar {
336336
if (i === 0) {
337337
this.yaxisLabelsTextsPos.push({
338338
x: p.x,
339-
y: p.y
339+
y: p.y,
340340
})
341341
}
342342

@@ -375,7 +375,7 @@ class Radar {
375375

376376
const xaxisLabelsConfig = w.config.xaxis.labels
377377
let elXAxisWrap = this.graphics.group({
378-
class: 'apexcharts-xaxis'
378+
class: 'apexcharts-xaxis',
379379
})
380380

381381
let polygonPos = Utils.getPolygonPos(this.size, this.dataPointsLen)
@@ -390,7 +390,7 @@ class Radar {
390390
let text = formatter(label, {
391391
seriesIndex: -1,
392392
dataPointIndex: i,
393-
w
393+
w,
394394
})
395395

396396
dataLabels.plotDataLabelsText({
@@ -409,9 +409,9 @@ class Radar {
409409
dataLabelsConfig: {
410410
textAnchor: textPos.textAnchor,
411411
dropShadow: { enabled: false },
412-
...xaxisLabelsConfig
412+
...xaxisLabelsConfig,
413413
},
414-
offsetCorrection: false
414+
offsetCorrection: false,
415415
})
416416
}
417417
})
@@ -449,7 +449,7 @@ class Radar {
449449
linePathsFrom,
450450
linePathsTo,
451451
areaPathsFrom,
452-
areaPathsTo
452+
areaPathsTo,
453453
}
454454
}
455455

@@ -482,7 +482,7 @@ class Radar {
482482
return {
483483
textAnchor,
484484
newX,
485-
newY
485+
newY,
486486
}
487487
}
488488

0 commit comments

Comments
 (0)