Justin-ZS commented on code in PR #21506:
URL: https://github.com/apache/echarts/pull/21506#discussion_r3109863499
##########
src/label/LabelManager.ts:
##########
@@ -457,8 +459,78 @@ class LabelManager {
return item.layoutOption.moveOverlap === 'shiftY';
});
- shiftLayoutOnXY(labelsNeedsAdjustOnX, 0, 0, width);
- shiftLayoutOnXY(labelsNeedsAdjustOnY, 1, 0, height);
+ // Group labels by grid (not by series) so that labels of multiple
series
+ // in the same grid avoid overlapping each other.
+ const labelsByGridX: Dictionary<LabelLayoutWithGeometry[]> = {};
+ const labelsByGridY: Dictionary<LabelLayoutWithGeometry[]> = {};
+
+ function getGridName(inputItem: LabelLayoutWithGeometry): string {
Review Comment:
This bucket/bounds lookup only works for Cartesian because it reads
`coordinateSystem.master.name/getRect()`. `singleAxis` and `matrix` keep `name`
and `getRect()` on `coordinateSystem` itself, so they still fall into
`grid_default` and share whole-canvas bounds. Could we use `const owner =
coordSys.master || coordSys` here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]