You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/02/25 04:54:40 UTC
[GitHub] [echarts] pissang commented on a change in pull request #14343: fix(markArea): markArea background color disappeared. close #13647
pissang commented on a change in pull request #14343:
URL: https://github.com/apache/echarts/pull/14343#discussion_r582544639
##########
File path: src/component/marker/MarkAreaView.ts
##########
@@ -248,22 +248,19 @@ class MarkAreaView extends MarkerView {
const points = map(dimPermutations, function (dim) {
return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);
});
+ const xScale = coordSys.getAxis('x').scale;
+ const yScale = coordSys.getAxis('y').scale;
+ const xAxis = xScale.getExtent();
Review comment:
Use a more specific name here. For example `xAxisExtent`, `yAxisExtent`
##########
File path: src/component/marker/MarkAreaView.ts
##########
@@ -248,22 +248,19 @@ class MarkAreaView extends MarkerView {
const points = map(dimPermutations, function (dim) {
return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);
});
+ const xScale = coordSys.getAxis('x').scale;
+ const yScale = coordSys.getAxis('y').scale;
+ const xAxis = xScale.getExtent();
+ const yAxis = yScale.getExtent();
+ const xPoint = [xScale.parse(areaData.get('x0', idx)), xScale.parse(areaData.get('x1', idx))];
+ const yPoint = [yScale.parse(areaData.get('y0', idx)), yScale.parse(areaData.get('y1', idx))];
+ xPoint.sort();
+ yPoint.sort();
Review comment:
There is a helper to sort an array to asc order. https://github.com/apache/echarts/blob/master/src/util/number.ts#L145
Default compare function in sort will convert the values to strings and use Unicode to compare. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#parameters
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org