You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2022/06/02 00:05:01 UTC

[GitHub] [echarts] biankaiwen111 opened a new issue, #17145: [Bug] 热力图在一些合法数据的情况下产生空白的图像

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: 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


[GitHub] [echarts] susiwen8 closed issue #17145: [Bug] 热力图在一些合法数据的情况下产生空白的图像

Posted by GitBox <gi...@apache.org>.
susiwen8 closed issue #17145: [Bug] 热力图在一些合法数据的情况下产生空白的图像
URL: https://github.com/apache/echarts/issues/17145


-- 
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] biankaiwen commented on issue #17145: [Bug] 热力图在一些合法数据的情况下产生空白的图像

Posted by GitBox <gi...@apache.org>.
biankaiwen commented on issue #17145:
URL: https://github.com/apache/echarts/issues/17145#issuecomment-1146299584

   @tyn1998 That helps a lot! thank you very much!


-- 
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] tyn1998 commented on issue #17145: [Bug] 热力图在一些合法数据的情况下产生空白的图像

Posted by GitBox <gi...@apache.org>.
tyn1998 commented on issue #17145:
URL: https://github.com/apache/echarts/issues/17145#issuecomment-1145849634

   Hello @biankaiwen111, please add file "value" to "encode", like this:
   
   <img width="1353" alt="image" src="https://user-images.githubusercontent.com/32434520/171841515-0bbe2e02-9a4e-40b2-8aa7-c6cb23162d94.png">
   
   Here is the [doc](https://echarts.apache.org/zh/option.html#series-heatmap.encode):
   
   <img width="1356" alt="image" src="https://user-images.githubusercontent.com/32434520/171841689-e27fef75-9791-4ea1-aa68-8b1628965b8c.png">
   
   I hope it helps.


-- 
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] echarts-bot[bot] commented on issue #17145: [Bug] 热力图在一些合法数据的情况下产生空白的图像

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #17145:
URL: https://github.com/apache/echarts/issues/17145#issuecomment-1144265380

   @biankaiwen111 It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗
   <details><summary><b>TRANSLATED</b></summary><br>
   
   **TITLE**
   
   [Bug] Heat maps produce blank images in the case of some legitimate data
   
   **BODY**
   
   ### Version
   
   5.2.2 and before
   
   ### Link to Minimal Reproduction
   
   _No response_
   
   ### Steps to Reproduce
   
   For the following settings, the heatmap can be drawn correctly
   ````
   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)
   
   But when I exchanged two columns in the original data (exchanged "Gender" to the first column), the heat map could not be drawn. Here, the x and y axes are confirmed by the column names.
   ````
   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
   
   Heatmap result is empty
   
   ### Expected Behavior
   
   The heatmap should still draw the image correctly
   
   ### Environment
   
   ````markdown
   - OS: macOS
   - Browser: Chrome
   - Framework:
   ````
   
   
   ### Any additional comments?
   
   _No response_
   </details>


-- 
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