Skip to content

Commit 23a9123

Browse files
authored
fix: annotations loss caused by legend filter (#3000)
1 parent a83cd2d commit 23a9123

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

packages/plots/src/core/utils/transform.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export const transformOptions = (params: Adaptor) => {
7070
if (isArray(config[key])) {
7171
config[key].forEach((annotation) => {
7272
children.push(transformConfig({
73+
data: [],
7374
tooltip: false,
7475
...annotation
7576
}));

site/examples/statistics/annotation-shape/demo/watermark.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const DemoAnnotationShape = () => {
3737
style: {
3838
x: '80%',
3939
y: '70%',
40-
render: ({ x, y }, context, d) => {
40+
render: ({ x, y }, context) => {
4141
const { document } = context;
4242
const g = document.createElement('g', {});
4343
const c1 = document.createElement('circle', {
@@ -65,6 +65,7 @@ const DemoAnnotationShape = () => {
6565
x,
6666
y,
6767
text: '数据保密',
68+
transformOrigin: 'center',
6869
transform: 'rotate(30)',
6970
fontSize: 20,
7071
fill: 'red',

site/examples/statistics/pie/demo/basic-donut.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ const DemoPie = () => {
3131
annotations: [
3232
{
3333
type: 'text',
34-
data: [],
3534
style: {
3635
text: 'AntV\nCharts',
3736
x: '50%',

0 commit comments

Comments
 (0)