forked from github/dataease
commit
fdf01f0471
@ -19,6 +19,7 @@ export const CHART_MIX_EDITOR_PROPERTY_INNER: EditorPropertyInner = {
|
|||||||
'basic-style-selector': [
|
'basic-style-selector': [
|
||||||
'colors',
|
'colors',
|
||||||
'alpha',
|
'alpha',
|
||||||
|
'gradient',
|
||||||
'lineWidth',
|
'lineWidth',
|
||||||
'lineSymbol',
|
'lineSymbol',
|
||||||
'lineSymbolSize',
|
'lineSymbolSize',
|
||||||
|
@ -3,7 +3,14 @@ import {
|
|||||||
G2PlotDrawOptions
|
G2PlotDrawOptions
|
||||||
} from '@/views/chart/components/js/panel/types/impl/g2plot'
|
} from '@/views/chart/components/js/panel/types/impl/g2plot'
|
||||||
import { DualAxes, DualAxesOptions } from '@antv/g2plot/esm/plots/dual-axes'
|
import { DualAxes, DualAxesOptions } from '@antv/g2plot/esm/plots/dual-axes'
|
||||||
import { getAnalyse, getLabel, getPadding, getYAxis, getYAxisExt } from '../../common/common_antv'
|
import {
|
||||||
|
getAnalyse,
|
||||||
|
getLabel,
|
||||||
|
getPadding,
|
||||||
|
getYAxis,
|
||||||
|
getYAxisExt,
|
||||||
|
setGradientColor
|
||||||
|
} from '../../common/common_antv'
|
||||||
import { flow, hexColorToRGBA, parseJson } from '@/views/chart/components/js/util'
|
import { flow, hexColorToRGBA, parseJson } from '@/views/chart/components/js/util'
|
||||||
import { cloneDeep, isEmpty, defaultTo, map, filter } from 'lodash-es'
|
import { cloneDeep, isEmpty, defaultTo, map, filter } from 'lodash-es'
|
||||||
import { valueFormatter } from '@/views/chart/components/js/formatter'
|
import { valueFormatter } from '@/views/chart/components/js/formatter'
|
||||||
@ -63,20 +70,31 @@ export class ColumnLineMix extends G2PlotChartView<DualAxesOptions, DualAxes> {
|
|||||||
})
|
})
|
||||||
// custom color
|
// custom color
|
||||||
const customAttr = parseJson(chart.customAttr)
|
const customAttr = parseJson(chart.customAttr)
|
||||||
const color = customAttr.basicStyle.colors
|
let color = customAttr.basicStyle.colors
|
||||||
|
|
||||||
|
color = color.map(ele => {
|
||||||
|
const tmp = hexColorToRGBA(ele, customAttr.basicStyle.alpha)
|
||||||
|
if (customAttr.basicStyle.gradient) {
|
||||||
|
return setGradientColor(tmp, true, 270)
|
||||||
|
} else {
|
||||||
|
return tmp
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// options
|
// options
|
||||||
const initOptions: DualAxesOptions = {
|
const initOptions: DualAxesOptions = {
|
||||||
data: [data1, data2],
|
data: [data1, data2],
|
||||||
xField: 'field',
|
xField: 'field',
|
||||||
yField: ['value', 'valueExt'], //这里不能设置成一样的
|
yField: ['value', 'valueExt'], //这里不能设置成一样的
|
||||||
appendPadding: getPadding(chart),
|
appendPadding: getPadding(chart),
|
||||||
color,
|
|
||||||
geometryOptions: [
|
geometryOptions: [
|
||||||
{
|
{
|
||||||
geometry: data1Type
|
geometry: data1Type,
|
||||||
|
color: color[0]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
geometry: data2Type
|
geometry: data2Type,
|
||||||
|
color: color[1]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
interactions: [
|
interactions: [
|
||||||
|
Loading…
Reference in New Issue
Block a user