From b8c8919e417b5d4a48824365dcc7735bc75cd192 Mon Sep 17 00:00:00 2001 From: arcsin1 Date: Thu, 13 Aug 2020 15:12:30 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E5=A2=9E=E5=8A=A0histogram=E7=9A=84exa?= =?UTF-8?q?mple=E5=92=8C=E6=96=87=E6=A1=A3=20(#1422)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: 增加histogram的文档 增加histogram的文档 * style: 简化代码 * style: rebase和简化代码 --- examples/histogram/basic/API.en.md | 18 ++++++------------ examples/histogram/basic/API.zh.md | 16 +++++----------- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/examples/histogram/basic/API.en.md b/examples/histogram/basic/API.en.md index 51be492bdc..e49e5dcf4c 100644 --- a/examples/histogram/basic/API.en.md +++ b/examples/histogram/basic/API.en.md @@ -1,5 +1,5 @@ --- -title: API +title: API --- # 配置属性 @@ -36,12 +36,7 @@ title: API | range | _number[]_ | 字段的数据映射区间,默认为[0,1] | ```js -const data = [ - { value: 20 }, - { value: 34 }, - { value: 56 }, - { value: 67 } -]; +const data = [{ value: 20 }, { value: 34 }, { value: 56 }, { value: 67 }]; const HistogramPlot = new Histogram(document.getElementById('container'), { data, @@ -55,8 +50,10 @@ const HistogramPlot = new Histogram(document.getElementById('container'), { max: 20, nice: true, alias: '数量', - formatter:(v)=>{return `${v}个`} - } + formatter: (v) => { + return `${v}个`; + }, + }, }, // highlight-end binField: 'value', @@ -96,7 +93,6 @@ columnStyle ✨ 功能描述: 设置直方图柱子样式。 - | 细分配置 | 类型 | 功能描述 | | ------------- | ------ | ---------- | | fill | string | 填充颜色 | @@ -106,5 +102,3 @@ columnStyle ✨ | opacity | number | 整体透明度 | | fillOpacity | number | 填充透明度 | | strokeOpacity | number | 描边透明度 | - - diff --git a/examples/histogram/basic/API.zh.md b/examples/histogram/basic/API.zh.md index 92c3d6ff76..e49e5dcf4c 100644 --- a/examples/histogram/basic/API.zh.md +++ b/examples/histogram/basic/API.zh.md @@ -36,12 +36,7 @@ title: API | range | _number[]_ | 字段的数据映射区间,默认为[0,1] | ```js -const data = [ - { value: 20 }, - { value: 34 }, - { value: 56 }, - { value: 67 } -]; +const data = [{ value: 20 }, { value: 34 }, { value: 56 }, { value: 67 }]; const HistogramPlot = new Histogram(document.getElementById('container'), { data, @@ -55,8 +50,10 @@ const HistogramPlot = new Histogram(document.getElementById('container'), { max: 20, nice: true, alias: '数量', - formatter:(v)=>{return `${v}个`} - } + formatter: (v) => { + return `${v}个`; + }, + }, }, // highlight-end binField: 'value', @@ -96,7 +93,6 @@ columnStyle ✨ 功能描述: 设置直方图柱子样式。 - | 细分配置 | 类型 | 功能描述 | | ------------- | ------ | ---------- | | fill | string | 填充颜色 | @@ -106,5 +102,3 @@ columnStyle ✨ | opacity | number | 整体透明度 | | fillOpacity | number | 填充透明度 | | strokeOpacity | number | 描边透明度 | - -