forked from github/dataease
Merge pull request #9346 from dataease/pr@dev-v2@chart-quadrant-fix
fix(图表-象限图): 修复象限图无法跳转、联动、下钻的问题
This commit is contained in:
commit
0438fa0187
@ -149,6 +149,8 @@ export class Quadrant extends G2PlotChartView<ScatterOptions, G2Scatter> {
|
|||||||
const dataLength = chart.data?.data.length / chart.data?.fields.length
|
const dataLength = chart.data?.data.length / chart.data?.fields.length
|
||||||
for (let index = 0; index < dataLength; index++) {
|
for (let index = 0; index < dataLength; index++) {
|
||||||
const tmpData = {
|
const tmpData = {
|
||||||
|
dimensionList: groupedData[xFieldObj.name][index].dimensionList,
|
||||||
|
quotaList: groupedData[xFieldObj.name][index].quotaList,
|
||||||
[xFieldObj.name]: groupedData[xFieldObj.name][index].value
|
[xFieldObj.name]: groupedData[xFieldObj.name][index].value
|
||||||
}
|
}
|
||||||
if (groupedData[yFieldObj.name]) {
|
if (groupedData[yFieldObj.name]) {
|
||||||
@ -168,15 +170,23 @@ export class Quadrant extends G2PlotChartView<ScatterOptions, G2Scatter> {
|
|||||||
}
|
}
|
||||||
// x轴基准线 默认值
|
// x轴基准线 默认值
|
||||||
const xBaseline = (
|
const xBaseline = (
|
||||||
data.reduce((valueSoFar, currentItem) => {
|
(data.reduce((valueSoFar, currentItem) => {
|
||||||
return Math.max(valueSoFar, currentItem[xFieldObj.name])
|
return Math.max(valueSoFar, currentItem[xFieldObj.name])
|
||||||
}, 0) / 2
|
}, 0) +
|
||||||
|
data.reduce((valueSoFar, currentItem) => {
|
||||||
|
return Math.min(valueSoFar, currentItem[xFieldObj.name])
|
||||||
|
}, Infinity)) /
|
||||||
|
2
|
||||||
).toFixed()
|
).toFixed()
|
||||||
// y轴基准线 默认值
|
// y轴基准线 默认值
|
||||||
const yBaseline = (
|
const yBaseline = (
|
||||||
data.reduce((valueSoFar, currentItem) => {
|
(data.reduce((valueSoFar, currentItem) => {
|
||||||
return Math.max(valueSoFar, currentItem[yFieldObj.name])
|
return Math.max(valueSoFar, currentItem[yFieldObj.name])
|
||||||
}, 0) / 2
|
}, 0) +
|
||||||
|
data.reduce((valueSoFar, currentItem) => {
|
||||||
|
return Math.min(valueSoFar, currentItem[yFieldObj.name])
|
||||||
|
}, Infinity)) /
|
||||||
|
2
|
||||||
).toFixed()
|
).toFixed()
|
||||||
const defaultBaselineQuadrant = {
|
const defaultBaselineQuadrant = {
|
||||||
...chart.customAttr['quadrant']
|
...chart.customAttr['quadrant']
|
||||||
|
Loading…
Reference in New Issue
Block a user