You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "songwillow (via GitHub)" <gi...@apache.org> on 2024/08/06 01:40:45 UTC
[I] [Question] Custom series type - tooltip axis doesn't align with the rect [echarts]
songwillow opened a new issue, #20230:
URL: https://github.com/apache/echarts/issues/20230
### What problem does this feature solve?
I'm trying to replicate the behavior where the tooltip gets trigger on the middle of the rect. I have set the x axis to time and tooltip to trigger on axis and set the axisPointer to x. Somehow the axis gets triggered on the start of the rect instead. I'm using the custom type example as the base. How can I achieve something similar?
Related https://github.com/apache/echarts/issues/16948
[Heatmap axis example, with the right behavior](https://echarts.apache.org/examples/en/editor.html?c=heatmap-cartesian&code=PTAEAcCcFMBdYJbUgWgQcwHYHsYCgBjbTAZ1lAAtsBXSE0AXlAG09R3QByARgCYBDTgBou3QSM4DhXAMziuAFnmcArMoBs4th04B2ZQA5lATmXcADGbHDt7Hr3DSejiQ6cyXiz6pe2u6711vA29jbwtw7kc8AF0AbjwQCBh4JFQMHHwiUnIAE34AT3omVg4uAGV-WFp8gqcAMUgEWqcAFQpaEhahP04AdWhczGguwrbqEe6uAFliKc5y6kwW2ISkqDhEZDQsXGhCYjJQfNh-RhZmcxEr0BUYkUuRbif7lhvea9fH0BlPh5uFH83iIVEDvuowTddJCRAYYaBjPCLEjnqBeF8bnwRAoMU9fqBuLiCYCCUTuKCfmSIaAcf8ntDQOoyXCaWTEay6WibjIibxUTzObwPmjefi7g9UVCvqjJdKRMLzHKfmDUSTFRKQSqRNT1SxUQzdcxUSzDaj2aanjdxXqnqj0RqCcL7TaCfimQ7uCTjErybafdT3S7uAzdD6WQYfey-EreFaY6jrUb5cLQw7ePjncwFS8HsKZV8nWDhfjDcK1QXNaBS9qiyIDRXQCaG-aG8jKbnbfLW3nW_jvR3ibDWxSLK2A62GYm8yyp092bOuXWG3zscuncv8bSWCWlw98fyvhmwfiS4fscfK4a3RfQPW97Cc9uRC37wS46_uKqz47d0_XU8t2YfcSW4AU_19R1v24al-3AycoJnKCoyveUbkDID5S_V8hVXbD9y-NVH2YECRDA4j5TBElTweElyxoytCXoxlKLrFjGzY9lMxAgECM7DkWBA9cmNA3CBIA0TyIJEdAJA6lo2EhlGLEglw14gl5zU2NSM0_VNOLTTqJYCl3i-EciIpBVT
NI7SHgpOijMvKzmKrJy7wc9iRVs58wRHHivIJfN_KxW4nJEt9QpJRMRwpVN3Ogv0goZdCRybIKNP8rT23cld-OYCyhOywzmB1Ii5LBalLIeakiupeziscqqaxcxrb3Kh9mpYGC2rfUq-MNOSCvq_9SRaz0bM6p47K-OSdWm-luu4VKJvU7rMqUoacszCrBoqt0YhiPwADoAFt-HAAAKAAzJYCEQYhQHOhBYGgY6AEpQAAbz8FJaEwFgnpeo1XgB47LmB57QfRUAAB9oa4FBOHiPAAF9XoSbBwDuv6mC-9hYGwbAABtEHAAAuT6_HAbASCehBiHJzh8d8MpYCadB0GQBn-AADwQEgbDKHm-YABWwBBMGeyBydxspQCFkgGe5gXZZITAzvJ1mJj8ZHtGRnp2HQJpcmlvwKGgDAKFgBmVHMABSZW8YxhmLHt3X9dAbmAEFeYVimWYKcBoAZxBjugB3jiqfhyaoTp3fYEhwEJp6ABlxaDv2VaoAB3DXIC1sodfYPXtAKb2-ZN_3A4ZggqmgdBcDqOOI9OcnahIN3tAANz56h-EJ6Z1Yz9hjvF8mrj8U7ufJ5E_BrwmCGoQn-AAI0J9PNegJvcCQCWGaoJoAC9iFOQnw7Xy6ra4AhoAl5Bw-X7B4GwY7nZUV2i_dkhkCQX3Sg4GWyhq1DgzYWN0KCgAAML8EgLkcOeMA7p04GbKop1mayxOFHZu_Am7sCXsvaAhMK6y3jtnXO-dZbF2IS9cAFB-A019gA2WINyiwAKGvIhxCSH8FyNgLOAAhQmtBp7j04RwEgtCeFZwgUTXADNIDoGXvwc6NwVHXEOioV6nA_AF20aAQuHB9EHWRnEIAA)
[Custom type axis is triggered on the start of the rect](https://echarts.apache.org/examples/en/editor.html?c=custom-profile&code=G4QwTgBAJiA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yr5HKljUCWKrdlPzeXvgFgKv-QrwW5HyOKtxUr8kysVcq1VCqMUqs6EsFlpFvn4tfJq7-JLoUgqUcibI-rqWNOGb-fFACDBjjLpQ_Ut9_AZHlOAbBcFGIiRYkGbmTFSSsWenyrVMiVzVJcYlVkSxL5wSONMCY2rXBnTirEFEjqXpR0QggyiGAgA)
### What does the proposed API look like?
Axis is trigger on the middle of rect instead of the start
--
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] [Question] Custom series type - tooltip axis doesn't align with the rect [echarts]
Posted by "songwillow (via GitHub)" <gi...@apache.org>.
songwillow closed issue #20230: [Question] Custom series type - tooltip axis doesn't align with the rect
URL: https://github.com/apache/echarts/issues/20230
--
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] [Question] Custom series type - tooltip axis doesn't align with the rect [echarts]
Posted by "songwillow (via GitHub)" <gi...@apache.org>.
songwillow commented on issue #20230:
URL: https://github.com/apache/echarts/issues/20230#issuecomment-2270332684
Achieved it by subtracting it to the width
```
const height = api.size([0, 1])[1]
const width = end[0] - start[0]
const rectShape = echarts.graphic.clipRectByRect(
{
x: start[0] - width / 2,
y: start[1] - height / 2,
width,
height,
},
{
x: params.coordSys.x!,
y: params.coordSys.y!,
width: params.coordSys.width!,
height: params.coordSys.height!,
}
)
```
--
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