forked from github/dataease
refactor(图表): 统一图例的图标大小和样式
This commit is contained in:
parent
f1fdf0f59b
commit
4328b712ae
@ -295,7 +295,9 @@ export class Map extends L7PlotChartView<ChoroplethOptions, Choropleth> {
|
||||
color: legend.color
|
||||
},
|
||||
'l7plot-legend__category-marker': {
|
||||
...LEGEND_SHAPE_STYLE_MAP[legend.icon]
|
||||
...LEGEND_SHAPE_STYLE_MAP[legend.icon],
|
||||
width: '8px',
|
||||
height: '8px'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -401,6 +401,7 @@ export class Quadrant extends G2PlotChartView<ScatterOptions, G2Scatter> {
|
||||
}
|
||||
return chart
|
||||
}
|
||||
|
||||
protected configColor(chart: Chart, options: ScatterOptions): ScatterOptions {
|
||||
const { xAxis, yAxis, yAxisExt } = chart
|
||||
if (!(xAxis?.length && yAxis?.length && yAxisExt?.length)) {
|
||||
@ -408,6 +409,7 @@ export class Quadrant extends G2PlotChartView<ScatterOptions, G2Scatter> {
|
||||
}
|
||||
return this.configSingleDimensionColor(chart, options)
|
||||
}
|
||||
|
||||
public setupSeriesColor(chart: ChartObj, data?: any[]): ChartBasicStyle['seriesColor'] {
|
||||
const { xAxis, yAxis, yAxisExt } = chart
|
||||
if (!(xAxis?.length && yAxis?.length && yAxisExt?.length)) {
|
||||
@ -416,6 +418,21 @@ export class Quadrant extends G2PlotChartView<ScatterOptions, G2Scatter> {
|
||||
const tmp = data?.[0]?.data
|
||||
return setUpSingleDimensionSeriesColor(chart, tmp)
|
||||
}
|
||||
|
||||
protected configLegend(chart: Chart, options: ScatterOptions): ScatterOptions {
|
||||
const optionTmp = super.configLegend(chart, options)
|
||||
if (!optionTmp.legend) {
|
||||
return optionTmp
|
||||
}
|
||||
optionTmp.legend.marker.style = style => {
|
||||
return {
|
||||
r: 4,
|
||||
fill: style.fill
|
||||
}
|
||||
}
|
||||
return optionTmp
|
||||
}
|
||||
|
||||
protected setupOptions(chart: Chart, options: ScatterOptions) {
|
||||
return flow(
|
||||
this.configTheme,
|
||||
|
@ -220,6 +220,20 @@ export class Radar extends G2PlotChartView<RadarOptions, G2Radar> {
|
||||
}
|
||||
}
|
||||
|
||||
protected configLegend(chart: Chart, options: RadarOptions): RadarOptions {
|
||||
const optionTmp = super.configLegend(chart, options)
|
||||
if (!optionTmp.legend) {
|
||||
return optionTmp
|
||||
}
|
||||
optionTmp.legend.marker.style = style => {
|
||||
return {
|
||||
r: 4,
|
||||
fill: style.stroke
|
||||
}
|
||||
}
|
||||
return optionTmp
|
||||
}
|
||||
|
||||
protected setupOptions(chart: Chart, options: RadarOptions): RadarOptions {
|
||||
return flow(
|
||||
this.configTheme,
|
||||
|
@ -248,6 +248,20 @@ export class Scatter extends G2PlotChartView<ScatterOptions, G2Scatter> {
|
||||
}
|
||||
}
|
||||
|
||||
protected configLegend(chart: Chart, options: ScatterOptions): ScatterOptions {
|
||||
const optionTmp = super.configLegend(chart, options)
|
||||
if (!optionTmp.legend) {
|
||||
return optionTmp
|
||||
}
|
||||
optionTmp.legend.marker.style = style => {
|
||||
return {
|
||||
r: 4,
|
||||
fill: style.fill
|
||||
}
|
||||
}
|
||||
return optionTmp
|
||||
}
|
||||
|
||||
protected setupOptions(chart: Chart, options: ScatterOptions) {
|
||||
return flow(
|
||||
this.configTheme,
|
||||
|
Loading…
Reference in New Issue
Block a user