Skip to content

Commit

Permalink
Merge pull request #3436 from NoPayneNoGame/feature/bubble-chart-zsca…
Browse files Browse the repository at this point in the history
…le-toggle

add a toggle for a bubble chart's zscaling
  • Loading branch information
junedchhipa authored Oct 20, 2022
2 parents 5f70eb0 + b47a0f5 commit d486c93
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/charts/Scatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,13 @@ export default class Scatter {

if (zRatio !== Infinity) {
// means we have a bubble
finishRadius = w.globals.seriesZ[realIndex][dataPointIndex] / zRatio

const bubble = w.config.plotOptions.bubble
finishRadius = w.globals.seriesZ[realIndex][dataPointIndex]

if (bubble.zScaling) {
finishRadius /= zRatio
}

if (bubble.minBubbleRadius && finishRadius < bubble.minBubbleRadius) {
finishRadius = bubble.minBubbleRadius
}
Expand Down
1 change: 1 addition & 0 deletions src/modules/settings/Options.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ export default class Options {
}
},
bubble: {
zScaling: true,
minBubbleRadius: undefined,
maxBubbleRadius: undefined
},
Expand Down
1 change: 1 addition & 0 deletions types/apexcharts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ type ApexPlotOptions = {
}
}
bubble?: {
zScaling?: boolean
minBubbleRadius?: number
maxBubbleRadius?: number
}
Expand Down

0 comments on commit d486c93

Please sign in to comment.