This is an automated email from the ASF dual-hosted git repository.
wangzx pushed a commit to branch gh-pages
in repository https://gitbox.apache.org/repos/asf/echarts-examples.git
The following commit(s) were added to refs/heads/gh-pages by this push:
new 4682afe9 tweak ts code of the bump-chart example
4682afe9 is described below
commit 4682afe9d2685c8c5a5d42eaddf7d6312fba5d39
Author: plainheart <[email protected]>
AuthorDate: Sun Sep 24 06:40:01 2023 +0800
tweak ts code of the bump-chart example
---
public/examples/ts/bump-chart.ts | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/public/examples/ts/bump-chart.ts b/public/examples/ts/bump-chart.ts
index 761911f9..fbd18cea 100644
--- a/public/examples/ts/bump-chart.ts
+++ b/public/examples/ts/bump-chart.ts
@@ -45,7 +45,7 @@ const generateRankingData = (): Map<string, number[]> => {
for (const _ of years) {
const shuffleArray = shuffle(defaultRanking);
names.forEach((name, i) => {
- map.set(name, [...(map.get(name) ?? []), shuffleArray[i]]);
+ map.set(name, (map.get(name) || []).concat(shuffleArray[i]));
});
}
return map;
@@ -55,9 +55,9 @@ const generateSeriesList = (): SeriesOption[] => {
const seriesList: SeriesOption[] = [];
const rankingMap = generateRankingData();
- for (const key of Array.from(rankingMap.keys())) {
+ rankingMap.forEach((data, name) => {
const series: SeriesOption = {
- name: key,
+ name,
symbolSize: 20,
type: 'line',
smooth: true,
@@ -72,10 +72,10 @@ const generateSeriesList = (): SeriesOption[] => {
lineStyle: {
width: 4
},
- data: rankingMap.get(key)
+ data
};
seriesList.push(series);
- }
+ });
return seriesList;
};
@@ -123,3 +123,5 @@ option = {
},
series: generateSeriesList()
};
+
+export {};
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]