提交 5d6fd877 编写于 作者: O Ovilia

feat(decal): support "none" to disable decal

上级 3e7bdc37
......@@ -23,13 +23,17 @@ const decalKeys = [
/**
* Create or update pattern image from decal options
*
* @param {InnerDecalObject} decalObject decal options
* @return {Pattern} pattern with generated image
* @param {InnerDecalObject | 'none'} decalObject decal options, 'none' if no decal
* @return {Pattern} pattern with generated image, null if no decal
*/
export function createOrUpdatePatternFromDecal(
decalObject: InnerDecalObject,
decalObject: InnerDecalObject | 'none',
api: ExtensionAPI
): PatternObject {
if (decalObject === 'none') {
return null;
}
const dpr = api.getDevicePixelRatio();
const zr = api.getZr();
const isSVG = zr.painter.type === 'svg';
......
......@@ -871,7 +871,7 @@ export interface SymbolOptionMixin<T = unknown> {
export interface ItemStyleOption extends ShadowOptionMixin, BorderOptionMixin {
color?: ZRColor
opacity?: number
decal?: DecalObject[]
decal?: DecalObject | 'none'
}
/**
......
......@@ -128,15 +128,25 @@ under the License.
if (i === 0) {
s.itemStyle = itemStyle;
}
else if (i === 1) {
s.itemStyle = {
decal: 'none'
};
}
else if (i === 2) {
s.data = [{
value: s.data[0],
itemStyle: {
decal: 'none'
}
}];
}
series.push(s);
var p = {
name: 'pie' + i,
value: i * 5 + 10
};
if (i === 0) {
p.itemStyle = itemStyle;
}
pieData.push(p);
legendNames.push('bar' + i, 'pie' + i);
......@@ -175,7 +185,8 @@ under the License.
title: [
'It should use decal when aria.show is true',
'(1) Each bar and pie piece should have different decal',
'(2) The first bar and pie piece decal should be blue'
'(2) The first bar decal should be blue',
'(3) The second and third bar should not have decal'
],
option: option
// height: 300,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册