You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "SakshamSinghal20 (via GitHub)" <gi...@apache.org> on 2026/01/30 07:32:19 UTC
[PR] heatmaps [echarts]
SakshamSinghal20 opened a new pull request, #21502:
URL: https://github.com/apache/echarts/pull/21502
This pull request is in the type of:
bug fixing
new feature
others
What does this PR do?
Fixes heatmap axis type validation inconsistency between dev and prod builds, enabling support for time and value axes.
Fixed issues
#21492 : Heatmap with time/value axes throws error in dev but works in prod
Details
Before: What was the problem?
Heatmaps using xAxis.type = "time" or "value" and yAxis.type = "value" behaved differently across builds:
Dev build: Threw runtime error "Heatmap on cartesian must have two category axes"
Prod build: Rendered successfully without errors
The root cause was validation code wrapped in __DEV__ blocks (lines 186-193 in HeatmapView.ts) that enforced category axes only in development builds. This validation was stripped during production minification, creating inconsistent behavior and making it unclear what axis types are officially supported.
After: How does it behave after the fixing?
Both dev and prod builds now consistently support heatmaps with any combination of category, time, or value axes:
Removed the restrictive __DEV__ validation checks
Implemented dynamic cell size calculation:
Category axes with onBand: Use getBandWidth() (preserves original behavior)
Time/Value axes: Calculate cell dimensions as pixelSpan / dataSpan
Both X and Y axes are handled independently based on their type
The fix is fully backward compatible—existing heatmaps with category axes continue to work exactly as before, while time and value axes are now officially supported in both build types.
Document Info
One of the following should be checked.
This PR doesn't relate to document changes
The document should be updated later
The document changes have been made in apache/echarts-doc#xxx
Misc
Security Checking
This PR uses security-sensitive Web APIs.
ZRender Changes
This PR depends on ZRender changes (ecomfe/zrender#xxx).
Related test cases or examples to use the new APIs
Test case added: test/heatmap-time-value-axes.html demonstrates heatmap with time xAxis and value yAxis.
Merging options
Please squash the commits into a single one when merging.
Other information
N/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
Re: [PR] heatmaps [echarts]
Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on PR #21502:
URL: https://github.com/apache/echarts/pull/21502#issuecomment-3822285011
Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout [the coding standard](https://echarts.apache.org/en/coding-standard.html) and Wiki about [How to make a pull request](https://github.com/apache/echarts/wiki/How-to-make-a-pull-request).
Please **DO NOT** commit the files in [dist](https://github.com/apache/echarts/tree/master/dist), [i18n](https://github.com/apache/echarts/tree/master/i18n), and [ssr/client/dist](https://github.com/apache/echarts/tree/master/ssr/client/dist) folders in a non-release pull request. These folders are for release use only.
⚠️ MISSING DOCUMENT INFO: Please make sure one of the document options are checked in this PR's description. Search "Document Info" in the description of this PR. This should be done either by the author or the reviewers of the PR.
--
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: [PR] fix(heatmap): support time and value axes in cartesian coordinate #21492 [echarts]
Posted by "SakshamSinghal20 (via GitHub)" <gi...@apache.org>.
SakshamSinghal20 commented on PR #21502:
URL: https://github.com/apache/echarts/pull/21502#issuecomment-3830493917
@plainheart @100pah could you please review this at your convenience?
--
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: [PR] fix(heatmap): support time and value axes in cartesian coordinate #21492 [echarts]
Posted by "KnightJaime (via GitHub)" <gi...@apache.org>.
KnightJaime commented on PR #21502:
URL: https://github.com/apache/echarts/pull/21502#issuecomment-4037450898
Any updates on this?
It would be really helpful if the heatmap supported a time axis. Ideally, the axis labels could use time formatters similar to the regular time axis, for example:
```
formatter: {
day: '{bold|{MM}-{dd}}',
month: '{bold|{MM}-{dd}}',
year: '{bold|{yyyy}}',
hour: '{HH}:{mm}',
},
```
and the axis would automatically prioritize displaying day, month, and year labels when overlaps occur.
Currently, using a category axis, I have to approximate this with `customValues`. However, this approach works poorly when `dataZoom `is involved.
--
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: [PR] fix(heatmap): support time and value axes in cartesian coordinate #21492 [echarts]
Posted by "SakshamSinghal20 (via GitHub)" <gi...@apache.org>.
SakshamSinghal20 closed pull request #21502: fix(heatmap): support time and value axes in cartesian coordinate #21492
URL: https://github.com/apache/echarts/pull/21502
--
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