-
Notifications
You must be signed in to change notification settings - Fork 19.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(markArea): markArea background color disappeared. close #13647 #14343
Conversation
Thanks for your contribution! |
src/component/marker/MarkAreaView.ts
Outdated
@@ -248,22 +248,19 @@ class MarkAreaView extends MarkerView { | |||
const points = map(dimPermutations, function (dim) { | |||
return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api); | |||
}); | |||
const xAxis = coordSys.getAxis('x').scale.getExtent(); | |||
const yAxis = coordSys.getAxis('y').scale.getExtent(); | |||
const xPoint = [coordSys.getAxis('x').scale.parse(areaData.get('x0', idx)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to 'cache' coordSys.getAxis('x').scale
and coordSys.getAxis('y').scale
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for your advice :-)
src/component/marker/MarkAreaView.ts
Outdated
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for helping!
src/component/marker/MarkAreaView.ts
Outdated
@@ -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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a more specific name here. For example xAxisExtent
, yAxisExtent
Congratulations! Your PR has been merged. Thanks for your contribution! 👍 |
Brief Information
This pull request is in the type of:
What does this PR do?
fix markArea background color disappearing when markArea inclued selected area
Fixed issues
Details
Before: What was the problem?
when selected area was included in markArea, then point would not meet condition that set allClipped to false.
After: How is it fixed in this PR?
add condition that check if rectangle of markArea intersects the rectangle of display area.
Usage
Are there any API changes?
Related test cases or examples to use the new APIs
NA.
Others
Merging options
Other information