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/09/30 23:23:03 UTC
[GitHub] [echarts] htr3n opened a new issue #15821: Tooltip params are not passed properly when the value of one of the series is null, undefined or NaN
htr3n opened a new issue #15821:
URL: https://github.com/apache/echarts/issues/15821
### Version
5.2.1
### Reproduction link
[https://codepen.io/htr3n/pen/BaZVPGe](https://codepen.io/htr3n/pen/BaZVPGe)
### Steps to reproduce
1. Create a simple ECharts line graph with two value-based data series
2. Configure ECharts option so that the tooltip is triggered and define a custom tooltip formatter function called `tooltipFormatter`
3. Assign the first series data with `data: [null]`, `data: [undefined]` or `data: [NaN]`
4. Assign the second series data with any valid number, e.g. `data: [0]`
5. Pass the options to ECharts engine.
```javascript
function tooltipFormatter(params) {
console.log(params[1]?.seriesName);
console.log(params[0]?.seriesName);
}
const option = {
tooltip: {
trigger: "axis",
formatter: tooltipFormatter
},
xAxis: {
data: [1]
},
yAxis: {
show: true
},
series: [
{
type: "line",
name: "first",
data: [null]
// data: [NaN]
// data: [undefined]
},
{
type: "line",
name: "second",
data: [0],
}
]
};
```
### What is expected?
The tooltip formatter function `tooltipFormatter` should receive two series and their corresponding values: the first one with `null` (or `undefined`, `NaN`, respectively) and the second with `0`.
### What is actually happening?
The tooltip formatter function `tooltipFormatter` receives only one series which is the second, the first series is not passed in (perhaps due to its value is null, undefined, or NaN).
---
If the first series data is assigned with a valid number such as `data: [1]`, the tooltip formatter receives correctly two series with their corresponding values.
The use case is that, I would want the two series and their values passed into the custom tooltip formatter function regardless so that I can render them according to my application requirements. As the first data series is not passed in if its value is null, undefined, or NaN), the tooltip formatter cannot handle it normally in generic case but has to use some dirty workarounds.
<!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
<!-- This issue is in English. DO NOT REMOVE -->
--
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: commits-unsubscribe@echarts.apache.org
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
[GitHub] [echarts] ZeRego commented on issue #15821: Tooltip params are not passed properly when the value of one of the series is null, undefined or NaN
Posted by GitBox <gi...@apache.org>.
ZeRego commented on issue #15821:
URL: https://github.com/apache/echarts/issues/15821#issuecomment-1062824419
+1 for this issue. We also want to show tooltips when the value is null/undefined.
--
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: commits-unsubscribe@echarts.apache.org
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
[GitHub] [echarts] echarts-bot[bot] commented on issue #15821: Tooltip params are not passed properly when the value of one of the series is null, undefined or NaN
Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #15821:
URL: https://github.com/apache/echarts/issues/15821#issuecomment-931774780
Hi! We've received your issue and please be patient to get responded. 🎉
The average response time is expected to be within one day for weekdays.
In the meanwhile, please make sure that it contains **a minimum reproducible demo** and necessary **images** to illustrate. Otherwise, our committers will ask you to do so.
*A minimum reproducible demo* should contain as little data and components as possible but can still illustrate your problem. This is the best way for us to reproduce it and solve the problem faster.
You may also check out the [API](http://echarts.apache.org/api.html) and [chart option](http://echarts.apache.org/option.html) to get the answer.
If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical question.
If you are interested in the project, you may also subscribe to our [mailing list](https://echarts.apache.org/en/maillist.html).
Have a nice day! 🍵
--
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: commits-unsubscribe@echarts.apache.org
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
[GitHub] [echarts] ZeRego edited a comment on issue #15821: Tooltip params are not passed properly when the value of one of the series is null, undefined or NaN
Posted by GitBox <gi...@apache.org>.
ZeRego edited a comment on issue #15821:
URL: https://github.com/apache/echarts/issues/15821#issuecomment-1062824419
+1 for this issue. We also want to show tooltips when the value is null/undefined.
<a href="https://www.loom.com/share/4fa3288cc0c34637a978a2df1bfc6b88">
<p>Lightdash - no tooltip for null values - Watch Video</p>
<img style="max-width:300px;" src="https://cdn.loom.com/sessions/thumbnails/4fa3288cc0c34637a978a2df1bfc6b88-with-play.gif">
</a>
--
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: commits-unsubscribe@echarts.apache.org
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