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
[5.0] New tooltip design #12947
[5.0] New tooltip design #12947
Conversation
Thanks for your contribution! |
} | ||
|
||
const distanceArr = tooltipDataParams.map(params => { | ||
let dim = ''; |
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 zrUtil.map
instead of native map
return distance; | ||
}); | ||
const index = distanceArr.indexOf(Math.min(...distanceArr)); | ||
return { |
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 zrUtil.indexOf
instead of native indexOf.
@@ -985,7 +1077,8 @@ function calcTooltipPosition( | |||
): [number, number] { | |||
const domWidth = contentSize[0]; | |||
const domHeight = contentSize[1]; | |||
const gap = 5; | |||
const gap = 10; | |||
const offset = 5; | |||
let x = 0; |
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.
I can't get the difference between offset and gap
src/component/marker/markerHelper.ts
Outdated
@@ -81,9 +81,9 @@ function markerTypeCalculatorWithExtent( | |||
? data.getCalculationInfo('stackResultDimension') | |||
: targetDataDim; | |||
|
|||
const value = numCalculate(data, calcDataDim, markerType); | |||
const value = numCalculate(data, targetDataDim, markerType); |
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 put it in a separate PR and have further discussion about this change.
Also I found the display is wrong in And in the candlestick chart. The newline seems broken. Perhaps it's caused by this change https://github.com/apache/incubator-echarts/pull/12947/files#diff-a99622711c93ad25fc31052794ad226fL142 |
@pissang Tooltip is ready, please review it |
Congratulations! Your PR has been merged. Thanks for your contribution! |
Brief Information
This pull request is in the type of:
Progress
order
option for order, provided values arevalueAsc
|valueDesc
|legendDesc
|legendAsc
. Default islegendAsc
.item
).What does this PR do?
New tooltip style for 5.0
Tooltip arrow
When




trigger
wasitem
andposition
istop
|bottom
|left
|right
, Tooltip will show arrow and it points to current seriesTooltip border color
trigger
wasitem
, border color will be the color of this seriestrigger
wasaxis
, border color depends on whichever closer to cursor.Fixed issues
Close #12929
Details
Before: What was the problem?
After: How is it fixed in this PR?
Usage
Are there any API changes?
Related test cases or examples to use the new APIs
NA.
Others
Merging options
Other information
TODO