This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch feat-jitter in repository https://gitbox.apache.org/repos/asf/echarts-examples.git
commit ce54447ceb4957410f5d4933cbf79a8a0939d74b Author: Ovilia <zwl.s...@gmail.com> AuthorDate: Mon May 20 17:15:15 2024 +0800 doc(jitter): example of jittering scatter apache/echarts#19941 --- public/data/thumb-dark/scatter-jitter.png | Bin 0 -> 247506 bytes public/data/thumb-dark/scatter-jitter.webp | Bin 0 -> 25640 bytes public/data/thumb/scatter-jitter.png | Bin 0 -> 201889 bytes public/data/thumb/scatter-jitter.webp | Bin 0 -> 18320 bytes public/examples/ts/scatter-jitter.ts | 45 +++++++++++++++++++++++++++++ src/data/chart-list-data.js | 11 +++++++ 6 files changed, 56 insertions(+) diff --git a/public/data/thumb-dark/scatter-jitter.png b/public/data/thumb-dark/scatter-jitter.png new file mode 100644 index 00000000..4835378d Binary files /dev/null and b/public/data/thumb-dark/scatter-jitter.png differ diff --git a/public/data/thumb-dark/scatter-jitter.webp b/public/data/thumb-dark/scatter-jitter.webp new file mode 100644 index 00000000..3cfaed80 Binary files /dev/null and b/public/data/thumb-dark/scatter-jitter.webp differ diff --git a/public/data/thumb/scatter-jitter.png b/public/data/thumb/scatter-jitter.png new file mode 100644 index 00000000..94c735c1 Binary files /dev/null and b/public/data/thumb/scatter-jitter.png differ diff --git a/public/data/thumb/scatter-jitter.webp b/public/data/thumb/scatter-jitter.webp new file mode 100644 index 00000000..46abf01d Binary files /dev/null and b/public/data/thumb/scatter-jitter.webp differ diff --git a/public/examples/ts/scatter-jitter.ts b/public/examples/ts/scatter-jitter.ts new file mode 100644 index 00000000..aa78170c --- /dev/null +++ b/public/examples/ts/scatter-jitter.ts @@ -0,0 +1,45 @@ +/* +title: Scatter with Jittering +category: scatter +titleCN: 带抖动的散点图 +difficulty: 3 +*/ +const grid = { + left: 80, + right: 50 +}; +const width = myChart.getWidth() - grid.left - grid.right; +const data = []; +for (let day = 0; day < 7; ++day) { + for (let i = 0; i < 1000; ++i) { + const y = Math.tan(i) / 2 + 7; + data.push([day, y, Math.random()]); + } +} +option = { + title: { + text: 'Scatter with Jittering' + }, + grid, + xAxis: { + type: 'category', + jitter: (width / 7) * 0.8, + data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] + }, + yAxis: { + type: 'value', + max: 10, + min: 0 + }, + series: [ + { + name: 'Sleeping Hours', + type: 'scatter', + data, + colorBy: 'data', + itemStyle: { + opacity: 0.4 + } + } + ] +}; diff --git a/src/data/chart-list-data.js b/src/data/chart-list-data.js index 7ba34642..5244bb8b 100644 --- a/src/data/chart-list-data.js +++ b/src/data/chart-list-data.js @@ -1202,6 +1202,17 @@ export default [ "titleCN": "桑基图右对齐布局", "difficulty": 3 }, + { + "category": [ + "scatter" + ], + "id": "scatter-jitter", + "ts": true, + "tags": [], + "title": "Scatter with Jittering", + "titleCN": "带抖动的散点图", + "difficulty": 3 + }, { "category": [ "scatter" --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org