Skip to content

Commit

Permalink
docs: 增加histogram的example和文档 (#1422)
Browse files Browse the repository at this point in the history
* docs: 增加histogram的文档

增加histogram的文档

* style: 简化代码

* style: rebase和简化代码
  • Loading branch information
arcsin1 authored and BBSQQ committed Aug 25, 2020
1 parent 591378b commit b8c8919
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 23 deletions.
18 changes: 6 additions & 12 deletions examples/histogram/basic/API.en.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: API
title: API
---

# 配置属性
Expand Down Expand Up @@ -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,
Expand All @@ -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',
Expand Down Expand Up @@ -96,7 +93,6 @@ columnStyle ✨

功能描述: 设置直方图柱子样式。


| 细分配置 | 类型 | 功能描述 |
| ------------- | ------ | ---------- |
| fill | string | 填充颜色 |
Expand All @@ -106,5 +102,3 @@ columnStyle ✨
| opacity | number | 整体透明度 |
| fillOpacity | number | 填充透明度 |
| strokeOpacity | number | 描边透明度 |


16 changes: 5 additions & 11 deletions examples/histogram/basic/API.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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',
Expand Down Expand Up @@ -96,7 +93,6 @@ columnStyle ✨

功能描述: 设置直方图柱子样式。


| 细分配置 | 类型 | 功能描述 |
| ------------- | ------ | ---------- |
| fill | string | 填充颜色 |
Expand All @@ -106,5 +102,3 @@ columnStyle ✨
| opacity | number | 整体透明度 |
| fillOpacity | number | 填充透明度 |
| strokeOpacity | number | 描边透明度 |


0 comments on commit b8c8919

Please sign in to comment.