Skip to content
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

[Bug] Heat map: Selection does not work correctly #18794

Open
fvales opened this issue Jun 24, 2023 · 2 comments · May be fixed by #18835
Open

[Bug] Heat map: Selection does not work correctly #18794

fvales opened this issue Jun 24, 2023 · 2 comments · May be fixed by #18835
Labels
bug en This issue is in English
Milestone

Comments

@fvales
Copy link

fvales commented Jun 24, 2023

Version

5.4.2

Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?code=PYBwLglsB2AEC8sDeAoWszGAG0iAXMmurCMAM4SQyEBEmItxAvgDTECG0EAth9dEIAzDtnIBTdugDmAJwgATQqhKwAFuIjS1YOgFYADAFJaUkgzoBGY03RtiADwCCDiOWXF0YAJ4hxdAGN-cWlgWW9TT1gFfg5CAG1aSwAmDlNYJLTWDNT02gBmLIyAFiLaPTKANjKAdjKADjKATjLrVstW5MZspO6cvoKB4oG9AcqBmoH6gaaB6znLRgBdM3RyEGwqJ1lxOKJVNbVgAHdCMFkAV3Eo5hYzbxc3D1UfP0Dg0PDI1RiwPcSAMr8C6yGIRHoAMXkYLyABU1CDyDCegB1cQKaDiJEccEZWFXbG42gAWRgyIyAIu0BhKyi602YG2u2eB3IR1OGEu11UtzsZgAbm4LqJiRwCPsSDwIIJYAZVrA-A5CNZ5UFsAELtgOAAjbD-TlXeVhCDiaC6DJHeQALxgf2w3xIeqE5toAVNYHEsgd6G1wDAmB4Vj0JjuxAk8ixCRUJGgHB4-toAAUqQE1LAAMIcUHejC-BMafh8bp08R6gIehSkhT6gDklGg0j1Nflv3-UXQ8TlsuyelpB1g8Us2S7lj7B3iyWHPQAtLQx6p4vkpxlZ_OSPFisvaKv5R29Fud-2B5UD3PdwOaqe1x36lfz_Emnej4Ou13t2fn5Yh93YMlrwOUmXYp_0HJcf1He9LE3cCQMsfcf3yWCTx_YDIMvH9Klg28UNgx8cPvZJX2yRCCO_LsSOfZJJx_P8CLArte3vEdshqWDsm_d8QOojjD37Rd2JnD8-OgnihPHeDRJA5DJPvdCZOfbD5L4vClPHFVYG_RjP2_b9aM_bjsj0vjLDA79MMgkTsiaWCJPYiDP2k7JzM_OSWKwgTYHqXCPJSLjmNgLS-OSHSey4gzYFYuiPKM8cu24tjf3YrjDMEkCwOozj72gjLePElKVzEhdkJywr13QkqQOwir7zw6rPzi4jYN0wzYOo-LIPSqzYOy7IvMg-DuIMJD8uc4zytCyCqomz9aumoKGoirjmtgVDKLalqosSlaQPItzIOIxqCIOgq0uOzLn2gsDzr4-CrtyoqzvusrHtKm9jvs5SXtg3aAqa47VuM6iwMiz8wNMgG1Mu9iKOM272JihdLGQsDrLQ47ArU7CwIxxG8NMoaCJ-0bx2C_6wrJzbTJ27IRISy7kpW1L7zA6DrvHaDWaevcaaS-9kM516Lx5k772wgWQLw7LvuFiHEe_DnWuFhH1xMmXurV_rhag4bGY05WO0sdDacm4W-pm4WcfXQjhZhkn5b2taba4lmmefBiNs_Htecor2RefbHDou322YXeD4JD9dkPDrmhYC12-OwgaJeDmOX192WVc073Ad9y2DYDjSCc_aCw5s32QeMqO7Ng9D4OJxHE_jtS8NLwnfdthdSbj7aCOopPNujwXOyc7O1JHv2gvHiOOzA5Dp4HaC59Tuum4e2Al6H9CN8qqfU7w7fIK7aS_vX1eVeo4rYNn0fEcXwPYfHjODeQg-XN3ofLGw1_jP3s-O2t0-Gklrj31gOKiIDnbj0wlEJYLBYHMCAA&_source=echarts-doc-preview

Steps to Reproduce

Click on a cell in the heatmap

Current Behavior

All the cells in that particular column is selected

Expected Behavior

Only the clicked cell should be selected

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

@fvales fvales added the bug label Jun 24, 2023
@echarts-bot echarts-bot bot added en This issue is in English pending We are not sure about whether this is a bug/new feature. labels Jun 24, 2023
@Ovilia Ovilia added difficulty: easy Issues that can be fixed more easily than the average. and removed pending We are not sure about whether this is a bug/new feature. labels Jun 25, 2023
@echarts-bot
Copy link

echarts-bot bot commented Jun 25, 2023

This issue is labeled with difficulty: easy.
@fvales Would you like to debug it by yourself? This is a quicker way to get your problem fixed. Or you may wait for the community to fix.

Please have a look at How to debug ECharts if you'd like to give a try. 🤓

@Ovilia Ovilia added this to the TBD milestone Jun 25, 2023
@linghaoSu linghaoSu linked a pull request Jul 1, 2023 that will close this issue
8 tasks
@adaelixir
Copy link
Contributor

adaelixir commented Jul 2, 2024

selectedMode is based on the name of the series. It is mainly used in 1*1 data dimensions such as legends and bar charts.

Cells with the same name on the heat map will be selected at the same time.

In order to avoid modifying the source code, you can use mouse events to listen to params and highlight the style according to the data of the selected cell.

option = {
  .....
  series: [
  {
    name: 'Punch Card',
    type: 'heatmap',
    selectedMode: false, // disable selected mode
    data: data,
    itemStyle: {
        emphasis: {
          borderColor: 'black',
          borderWidth: 2
        }
    }
}]}
var previousSelected = null;
myChart.on('click', function (params) {
  // clear previous selected
  if (previousSelected) {
    myChart.dispatchAction({
         type: 'downplay',
         seriesIndex: 0,
         dataIndex: previousSelected.dataIndex
     });
 }
  //highlight current selected
    myChart.dispatchAction({
        type: 'highlight',
        seriesIndex: 0,
        dataIndex: params.dataIndex
  });
  previousSelected = params;
});

option && myChart.setOption(option);
image

@plainheart plainheart removed the difficulty: easy Issues that can be fixed more easily than the average. label Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug en This issue is in English
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants