diff --git a/resources/views/admin/home.blade.php b/resources/views/admin/home.blade.php index 3ae0dc4..3834697 100644 --- a/resources/views/admin/home.blade.php +++ b/resources/views/admin/home.blade.php @@ -386,6 +386,10 @@ var pieHeight = (100 - (pieRows - 1) * (gap / pieRows)) / pieRows; var option = { title: lies.map(function (item) { + var columnIndex = idx % pieColumns; // 当前饼图在其行中的列索引 + var rowIndex = Math.floor(idx / pieColumns); // 当前饼图的行索引 + var left = columnIndex * (pieWidth + gap / pieColumns); // 计算left位置 + var top = rowIndex * (pieHeight + gap / pieRows); // 计算top位置 return { text: item.product_item_name, left: left + '%',