You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "Ale142 (via GitHub)" <gi...@apache.org> on 2023/05/08 18:35:48 UTC
[GitHub] [echarts] Ale142 opened a new issue, #18599: [Bug] tooltip alignment with xAxis Date
Ale142 opened a new issue, #18599:
URL: https://github.com/apache/echarts/issues/18599
### Version
5.4.2
### Link to Minimal Reproduction
https://swej29.csb.app/
### Steps to Reproduce
1. Charts creation
```
var myChart1 = echarts.init(chart1, null, {
renderer: "canvas"
});
var myChart2 = echarts.init(chart2, null, {
renderer: "canvas"
});
```
2. Options
```
{
tooltip: {
trigger: "item",
formatter: function (params) {
return "Date: " + params.name + " | Value: " + params.data;
}
},
xAxis: {
type: "category",
data: [
"2023-05-05T16:00:00",
"2023-05-05T17:00:00",
"2023-05-05T19:00:00",
"2023-05-05T20:00:00",
"2023-05-05T21:00:00",
"2023-05-05T22:00:00"
]
},
yAxis: {
type: "value"
},
series: [
{
data: [820, 932, 901, 1290, 1330, 1320],
type: "line",
smooth: true
}
]
};
var option2;
option2 = {
tooltip: {
trigger: "item",
formatter: function (params) {
return "Date: " + params.name + " | Value: " + params.data;
}
},
xAxis: {
type: "category",
data: [
"2023-05-05T16:00:00",
"2023-05-05T17:00:00",
"2023-05-05T18:00:00",
"2023-05-05T19:00:00",
"2023-05-05T20:00:00",
"2023-05-05T21:00:00",
"2023-05-05T22:00:00"
]
},
yAxis: {
type: "value"
},
series: [
{
data: [820, 932, 901, 934, 1290, 1330, 1320],
type: "line",
smooth: true
}
]
};
```
3. Connect charts
```
echarts.connect([myChart1, myChart2]);
```
### Current Behavior
I would like the tooltip to synchronize according to the date of the selected point (or hover mouse).
### Expected Behavior
With the **connect** function synchronization is done on the X-axis. This causes the wrong display of some tooltips if the length of the two Xaxis arrays is different
<img width="643" alt="Screenshot 2023-05-08 alle 20 33 38" src="https://user-images.githubusercontent.com/39278753/236903409-a7b38d56-955e-491d-9a81-9d7c7b2d64e5.png">
### Environment
```markdown
- OS:
- Browser:
- Framework:
```
### Any additional comments?
How can be solved? I thought to try manually triggering the showTip using the dispatchAction but It doesn't work
--
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.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
Re: [I] [Bug] tooltip alignment with xAxis Date [echarts]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #18599:
URL: https://github.com/apache/echarts/issues/18599#issuecomment-2864309695
This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.
--
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
Re: [I] [Bug] tooltip alignment with xAxis Date [echarts]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #18599:
URL: https://github.com/apache/echarts/issues/18599#issuecomment-2887675344
This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!
--
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
Re: [I] [Bug] tooltip alignment with xAxis Date [echarts]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #18599: [Bug] tooltip alignment with xAxis Date
URL: https://github.com/apache/echarts/issues/18599
--
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] helgasoft commented on issue #18599: [Bug] tooltip alignment with xAxis Date
Posted by "helgasoft (via GitHub)" <gi...@apache.org>.
helgasoft commented on issue #18599:
URL: https://github.com/apache/echarts/issues/18599#issuecomment-1540880917
xAxis needs to be **the same** for both connected charts. Also, setting axis _data_ makes the axis automatically type _category_. You need xAxis type _time_, means all data has to be in the series.
_tooltip.trigger:"item"_ will not work for connected, has to be _tooltip.trigger:"**axis**"_
Try the following code. Tooltip has some glitches (first point or lower chart), but works most of the time.
```
op1 = {
tooltip: { trigger: "axis", formatter: '{c}'},
xAxis: { type: "time"},
yAxis: { type: "value"},
series: [
{
data: [
[ new Date("2023-05-05T16:00:00"),820],
[ new Date("2023-05-05T17:00:00"),932],
[ new Date("2023-05-05T19:00:00"),934],
[ new Date("2023-05-05T20:00:00"),1290],
[ new Date("2023-05-05T21:00:00"),1330],
[ new Date("2023-05-05T22:00:00"),1320]
],
type: "line",
smooth: true
}
]
};
op2 = echarts.util.clone(op1);
op2.series[0].data.splice(2, 0, [ new Date("2023-05-05T18:00:00"),901] );
chart1.setOption(op1);
chart2.setOption(op2);
echarts.connect([chart1, chart2]);
```
--
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