diff --git a/docs/manual/plots/pie.en.md b/docs/manual/plots/pie.en.md index cda8340bcb..456681ede1 100644 --- a/docs/manual/plots/pie.en.md +++ b/docs/manual/plots/pie.en.md @@ -140,7 +140,7 @@ With G2Plot, you can set the `innerRadius` to create concentric ring. ### Fan chart -By setting `startAngle` and `endAngle`,we can turn a pie plot into a fan chart. +By setting startAngle` and endAngle, we can turn a pie plot into a fan chart. diff --git a/docs/manual/plots/pie.zh.md b/docs/manual/plots/pie.zh.md index bf331d9f47..7cbb3a5b80 100644 --- a/docs/manual/plots/pie.zh.md +++ b/docs/manual/plots/pie.zh.md @@ -141,7 +141,7 @@ piePlot.render(); ### 扇形图 -通过设置饼图的 `startAngle` (开始角度) 和 `endAngle` (结束角度),我们可以将饼图变成扇形图 +通过设置饼图的 startAngle (开始角度) 和 endAngle (结束角度),我们可以将饼图变成扇形图 diff --git a/docs/manual/plugin.en.md b/docs/manual/plugin.en.md index 53a7409110..7361d799d0 100644 --- a/docs/manual/plugin.en.md +++ b/docs/manual/plugin.en.md @@ -59,6 +59,7 @@ The main process is divided into the following steps: | [G2Plot-QRCode](https://github.com/hustcc/G2Plot-QRCode) | [Go](https://git.hust.cc/G2Plot-QRCode) | Draw a QRCode with G2Plot. | [![npm](https://img.shields.io/npm/v/g2plot-qrcode.svg)](https://www.npmjs.com/package/g2plot-qrcode) | | [G2Plot-Column](https://github.com/yujs/G2Plot-Column) | [Go](https://yujs.github.io/G2Plot-Column/) | Customize Column with G2Plot. | [![npm](https://img.shields.io/npm/v/g2plot-column.svg)](https://www.npmjs.com/package/g2plot-column) | | [G2Plot-Lollipop](https://github.com/MrSmallLiu/G2Plot-Lollipop) | [Go](https://mrsmallliu.github.io/G2Plot-Lollipop/) | Welcome to G2Plot-Lollipop 👋 | [![npm](https://img.shields.io/npm/v/g2plot-lollipop.svg)](https://www.npmjs.com/package/g2plot-lollipop) | +| [G2Plot-Calendar](https://github.com/visiky/G2Plot-Calendar) | [Go](https://visiky.github.io/g2plot-calendar/) | A component like GitHub-contribution-calendar with G2Plot 📅 | [![npm](https://img.shields.io/npm/v/g2plot-calendar.svg)](https://www.npmjs.com/package/g2plot-calendar) | ## Technology stack packages diff --git a/docs/manual/plugin.zh.md b/docs/manual/plugin.zh.md index a8db911346..cda6ced4d7 100644 --- a/docs/manual/plugin.zh.md +++ b/docs/manual/plugin.zh.md @@ -59,6 +59,7 @@ plot.render(); | [G2Plot-QRCode](https://github.com/hustcc/G2Plot-QRCode) | [前往](https://git.hust.cc/G2Plot-QRCode) | Draw a QRCode with G2Plot. | [![npm](https://img.shields.io/npm/v/g2plot-qrcode.svg)](https://www.npmjs.com/package/g2plot-qrcode) | | [G2Plot-Column](https://github.com/yujs/G2Plot-Column) | [前往](https://yujs.github.io/G2Plot-Column/) | Customize Column with G2Plot. | [![npm](https://img.shields.io/npm/v/g2plot-column.svg)](https://www.npmjs.com/package/g2plot-column) | | [G2Plot-Lollipop](https://github.com/MrSmallLiu/G2Plot-Lollipop) | [前往](https://mrsmallliu.github.io/G2Plot-Lollipop/) | Welcome to G2Plot-Lollipop 👋 | [![npm](https://img.shields.io/npm/v/g2plot-lollipop.svg)](https://www.npmjs.com/package/g2plot-lollipop) | +| [G2Plot-Calendar](https://github.com/visiky/G2Plot-Calendar) | [前往](https://visiky.github.io/g2plot-calendar/) | A component like GitHub-contribution-calendar with G2Plot 📅 | [![npm](https://img.shields.io/npm/v/g2plot-calendar.svg)](https://www.npmjs.com/package/g2plot-calendar) | ## 技术栈封装 diff --git a/examples/plugin/multi-view/demo/combo-plot.ts b/examples/plugin/multi-view/demo/combo-plot.ts new file mode 100644 index 0000000000..2a14862da3 --- /dev/null +++ b/examples/plugin/multi-view/demo/combo-plot.ts @@ -0,0 +1,131 @@ +import { MultiView } from '@antv/g2plot'; + +const averageData = [ + { date: '2015-02', value: 21168 }, + { date: '2015-08', value: 21781 }, + { date: '2016-01', value: 23818 }, + { date: '2017-02', value: 25316 }, + { date: '2018-01', value: 26698 }, + { date: '2018-08', value: 27890 }, +]; + +const plot = new MultiView('container', { + appendPadding: 8, + tooltip: { shared: true }, + syncViewPadding: true, + plots: [ + { + type: 'column', + options: { + data: [ + { date: '2015-02', value: 160 }, + { date: '2015-08', value: 245 }, + { date: '2016-01', value: 487 }, + { date: '2017-02', value: 500 }, + { date: '2018-01', value: 503 }, + { date: '2018-08', value: 514 }, + ], + xField: 'date', + yField: 'value', + yAxis: { + type: 'log', + max: 100000, + }, + meta: { + date: { + sync: true, + }, + value: { + alias: '店数(间)', + }, + }, + label: { + position: 'middle', + }, + }, + }, + { + type: 'line', + options: { + data: averageData, + xField: 'date', + yField: 'value', + xAxis: false, + yAxis: { + type: 'log', + max: 100000, + }, + label: { + offsetY: -8, + }, + meta: { + value: { + alias: '平均租金(元)', + }, + }, + color: '#FF6B3B', + annotations: averageData.map((d) => { + return { + type: 'dataMarker', + position: d, + point: { + style: { + stroke: '#FF6B3B', + lineWidth: 1.5, + }, + }, + }; + }), + }, + }, + { + type: 'line', + options: { + data: [ + { date: '2015-02', value: null }, + { date: '2015-08', value: 0.029 }, + { date: '2016-01', value: 0.094 }, + { date: '2017-02', value: 0.148 }, + { date: '2018-01', value: 0.055 }, + { date: '2018-08', value: 0.045 }, + ], + xField: 'date', + yField: 'value', + xAxis: false, + yAxis: { + line: null, + grid: null, + position: 'right', + max: 0.16, + tickCount: 8, + }, + meta: { + date: { + sync: 'date', + }, + value: { + alias: '递增', + formatter: (v) => `${(v * 100).toFixed(1)}%`, + }, + }, + smooth: true, + label: { + callback: (value) => { + return { + offsetY: value === 0.148 ? 36 : value === 0.055 ? 0 : 20, + style: { + fill: '#1AAF8B', + fontWeight: 700, + stroke: '#fff', + lineWidth: 1, + }, + }; + }, + }, + color: '#1AAF8B', + }, + }, + ], +}); + +plot.render(); diff --git a/examples/plugin/multi-view/demo/meta.json b/examples/plugin/multi-view/demo/meta.json index f92edd77e6..371f87dc8d 100644 --- a/examples/plugin/multi-view/demo/meta.json +++ b/examples/plugin/multi-view/demo/meta.json @@ -20,6 +20,14 @@ }, "screenshot": "https://gw.alipayobjects.com/mdn/rms_f5c722/afts/img/A*19AdR6-BjRgAAAAAAAAAAABkARQnAQ" }, + { + "filename": "combo-plot.ts", + "title": { + "zh": "组合图表", + "en": "Combo plot" + }, + "screenshot": "https://gw.alipayobjects.com/zos/antfincdn/GMzV%24DSDAX/68a9190b-a4eb-4ad4-be3b-4fef31595a3f.png" + }, { "filename": "nobel-prize.ts", "title": {