hustcc / hustcc/echarts-for-react

Different options for data on the geo map (multi series)

Open
#482 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
5k
Forks
650
PR merge metrics
No merged PRs in 30d

Description

I have a geo map as below.
I want to be able to set different options like zlevel or silent for all data in series.data but I didn't find that option.
There is no such option for series.data , I tried to use the series array with each individual object for each data item but in this case I get empty values in data for some reason.

Works but it is not possible to set level or silent for each data item.
```
series: [
{
...scaleOpt,
name: currentData?.name,
type: "map",
map: activeMapId,
...otherOptions,
data: currentData?.jsonData.features.map(
({ properties }: Feature) => ({
id: properties?.id,
name: districtId
? getRegionCenterById(properties?.id)
: properties?.name,
value: Math.round(vdlValues[properties?.id] ?? NaN) || "-",
selected: selectedSubjectId === properties?.id,
itemStyle:
selectedSubjectId === properties?.id
? selectedAreaStyle
: {},
})
),
},
],
```

With this approach, for some unknown reason, the value in data is empty and is not displayed on the map.
```
series: currentData?.jsonData?.features?.map(({ properties }) => ({
...scaleOpt,
name: properties.name,
type: "map",
map: activeMapId,
...otherOptions,
data: [
{
name: properties?.name,
value: Math.round(vdlValues[properties?.id] ?? NaN) || "-",
selected: selectedSubjectId === properties?.id,
itemStyle:
selectedSubjectId === properties?.id ? selectedAreaStyle : {},
},
],
})),
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.