biankaiwen111 opened a new issue, #17145:
URL: https://github.com/apache/echarts/issues/17145

   ### Version
   
   5.2.2 及之前
   
   ### Link to Minimal Reproduction
   
   _No response_
   
   ### Steps to Reproduce
   
   对于如下的设定,热力图可以被正确的画出来
   ```
   option={
       "dataset": [
           {
               "id": "raw",
               "dimensions": [
                   "Survived",
                   "Pclass",
                   "CountOfRecords",
                   "Gender"
               ],
               "source": [
                   [1, 3, 47, "male"],
                   [1, 2, 17, "male"],
                   [1, 1, 45, "male"],
                   [0, 3, 300, "male"],
                   [0, 2, 91, "male"],
                   [0, 1, 77, "male"]
               ]
           },
           {
               "fromDatasetIndex": 0,
               "id": "sorting",
               "transform": {
                   "type": "sort",
                   "config": {
                       "dimension": "Pclass",
                       "order": "asc"
                   }
               }
           }
       ],
       "xAxis": {
           "type": "category",
           "name": "Pclass",
       },
       "yAxis": {
           "type": "category",
           "name": "Survived",
       },
       "series": [
           {
               "type": "heatmap",
               "datasetIndex": 1,
               "encode": {
                   "x": "Pclass",
                   "y": "Survived"
               }
           }
       ],
       "visualMap": [
           {
               "dimension": "CountOfRecords",
               "min": 17,
               "max": 300,
               "calculable": true,
               "orient": "vertical",
               "bottom": "50%",
               "right": "1%"
           }
       ]
   }
   ```
   
![1654126937858](https://user-images.githubusercontent.com/51461951/171519081-d18f5201-7bdc-4540-b770-635421b9971d.png)
   
   但是当我交换原数据里的某两列时(交换“Gender”到首列时),热力图却无法被画出,我这里x,y轴是根据列名确认的。
   ```
   option={
       "dataset": [
           {
               "id": "raw",
               "dimensions": [
                   "Gender",
                   "Survived",
                   "Pclass",
                   "CountOfRecords"
               ],
               "source": [
                   ["male", 1, 3, 47],
                   ["male", 1, 2, 17],
                   ["male", 1, 1, 45],
                   ["male", 0, 3, 300],
                   ["male", 0, 2, 91],
                   ["male", 0, 1, 77]
               ]
           },
           {
               "fromDatasetIndex": 0,
               "id": "sorting",
               "transform": {
                   "type": "sort",
                   "config": {
                       "dimension": "Pclass",
                       "order": "asc"
                   }
               }
           }
       ],
       "xAxis": {
           "type": "category",
           "name": "Pclass",
       },
       "yAxis": {
           "type": "category",
           "name": "Survived",
       },
       "series": [
           {
               "type": "heatmap",
               "datasetIndex": 1,
               "encode": {
                   "x": "Pclass",
                   "y": "Survived"
               }
           }
       ],
       "visualMap": [
           {
               "dimension": "CountOfRecords",
               "min": 17,
               "max": 300,
               "calculable": true,
               "orient": "vertical",
               "bottom": "50%",
               "right": "1%"
           }
       ]
   }
   ```
   
![1654127714539](https://user-images.githubusercontent.com/51461951/171520141-ccef7ed2-111d-48a2-9e46-2f1274bcb135.png)
   
   
   ### Current Behavior
   
   热力图结果为空
   
   ### Expected Behavior
   
   热力图应该依然能正确的画出图像
   
   ### Environment
   
   ```markdown
   - OS:macOS
   - Browser: Chrome
   - Framework:
   ```
   
   
   ### Any additional comments?
   
   _No response_


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to