Skip to content

Commit

Permalink
docs: migrate 4.0 Simple Rose diagram (antvis#5900)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenglingpeng committed May 31, 2024
1 parent 4809674 commit 20594dc
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
4 changes: 4 additions & 0 deletions site/examples/general/rose/demo/donut-rose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ const chart = new Chart({
width: 720,
height: 720,
});

chart.coordinate({ type: 'polar', innerRadius: 0.2 });

chart
.interval()
.data(data)
Expand Down Expand Up @@ -54,5 +56,7 @@ chart
lineWidth: 1,
stroke: '#fff',
});

chart.interaction('elementHighlight', true);

chart.render();
8 changes: 4 additions & 4 deletions site/examples/general/rose/demo/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,31 +34,31 @@
"en": "Wind Rose",
"zh": "Wind Rose"
},
"screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*Trl1TqdieqIAAAAAAAAAAAAADmJ7AQ/original"
"screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*pu1LTrmzMyUAAAAAAAAAAAAADmJ7AQ/original"
},
{
"filename": "nightingale-rose.ts",
"title": {
"zh": "南丁格尔玫瑰图",
"en": "Nightingale Rose"
},
"screenshot": "https://gw.alipayobjects.com/mdn/rms_f5c722/afts/img/A*jiIFQo6AS_kAAAAAAAAAAABkARQnAQ"
"screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*dHw7RYx7V3cAAAAAAAAAAAAADmJ7AQ/original"
},
{
"filename": "donut-rose.ts",
"title": {
"zh": "南丁格尔玫瑰环图",
"en": ""
},
"screenshot": "https://gw.alipayobjects.com/mdn/rms_f5c722/afts/img/A*zzxWR4deKaYAAAAAAAAAAABkARQnAQ"
"screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*FZtzRbGNkRMAAAAAAAAAAAAADmJ7AQ/original"
},
{
"filename": "polar-stack.ts",
"title": {
"en": "stacked column chart in polar coordinate",
"zh": "极坐标下的层叠柱状图"
},
"screenshot": "https://gw.alipayobjects.com/mdn/rms_f5c722/afts/img/A*bwKcRJFFUBAAAAAAAAAAAABkARQnAQ"
"screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*JWPuSIRzU_MAAAAAAAAAAAAADmJ7AQ/original"
}
]
}
3 changes: 3 additions & 0 deletions site/examples/general/rose/demo/nightingale-rose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const chart = new Chart({
width: 720,
});
chart.coordinate({ type: 'polar' });

chart
.interval()
.data(data)
Expand All @@ -44,5 +45,7 @@ chart
zIndex: 101,
})
.state('inactive', { opacity: 0.5, zIndex: 100 });

chart.interaction('elementHighlight', true);

chart.render();
5 changes: 4 additions & 1 deletion site/examples/general/rose/demo/polar-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ const chart = new Chart({
width: 720,
height: 720,
});

chart.coordinate({ type: 'polar', innerRadius: 0.1 });

chart
.interval()
// .line()
.data({
value: data,
transform: [
Expand Down Expand Up @@ -69,11 +70,13 @@ chart
})
.state('active', { stroke: 'black', lineWidth: 1, zIndex: 101 })
.state('inactive', { opacity: 0.5, zIndex: 100 });

chart.interaction('tooltip', {
body: false,
crosshairsStroke: 'red',
crosshairsStrokeWidth: 4,
});

chart.interaction('elementHighlight', true);

chart.render();
2 changes: 2 additions & 0 deletions site/examples/general/rose/demo/wind-rose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ const chart = new Chart({
height: 720,
padding: 50,
});

chart.coordinate({ type: 'polar' });

chart
Expand Down Expand Up @@ -166,4 +167,5 @@ chart
line: true,
gridLineWidth: 1,
});

chart.render();

0 comments on commit 20594dc

Please sign in to comment.