|
|
@@ -287,8 +287,10 @@ const fetchStatPhenologyAreaRatioByCropType = () => {
|
|
|
.then((res) => {
|
|
|
if (res.code === 0 && res.data && res.data.length > 0) {
|
|
|
// 转换接口数据为图表格式(物候进程分布)
|
|
|
- // 横轴:物候期名称,纵轴:面积占比(百分比)
|
|
|
- const categories = res.data.map((item) => item.speciesName);
|
|
|
+ // 横轴:作物名称(有物候期则为“作物名(物候期)”),纵轴:面积占比(百分比)
|
|
|
+ const categories = res.data.map((item) =>
|
|
|
+ item.phenologyName ? `${item.speciesName}(${item.phenologyName})` : item.speciesName
|
|
|
+ );
|
|
|
const values = res.data.map((item) => parseFloat((item.areaRatio * 100).toFixed(2)));
|
|
|
|
|
|
// 更新区域图表数据
|