softwords opened a new issue #12636:
URL: https://github.com/apache/incubator-echarts/issues/12636
### Version
4.7.0
### Steps to reproduce
A piecewise visual map that specifies categories cannot be applied to
dimension 0 of data.
This option works, specifying dimension 2:
```
option = {
"series": [
{
"encode": {
"itemId": 0,
"itemName": 0,
"value": "value",
"y": "value",
"x": "rowID"
},
"type": "bar",
"color": "#1f77b4"
}
],
"dataset": {
"dimensions": [
"rowID",
"value",
"id2"
],
source: [
["A", 1087,"A" ],
[ "B", 244,"B" ],
[ "C", 653,"C" ],
]
},
"xAxis": {
"type": "category",
},
"yAxis": {
"type": "value"
},
"visualMap": {
"id": "highlighter",
"type": "piecewise",
"show": false,
dimension: 2,
"categories": [
"A"
],
"inRange": {},
"outOfRange": {
"opacity": 0.4
}
}
}
```
This also, works: when dimension is omitted, it uses the last dimension as
documented:
```
option = {
"series": [
{
"encode": {
"itemId": 0,
"itemName": 0,
"value": "value",
"y": "value",
"x": "rowID"
},
"type": "bar",
"color": "#1f77b4"
}
],
"dataset": {
"dimensions": [
"rowID",
"value",
"id2"
],
source: [
["A", 1087,"A" ],
[ "B", 244,"B" ],
[ "C", 653,"C" ],
]
},
"xAxis": {
"type": "category",
},
"yAxis": {
"type": "value"
},
"visualMap": {
"id": "highlighter",
"type": "piecewise",
"show": false,
"categories": [
"B"
],
"inRange": {},
"outOfRange": {
"opacity": 0.4
}
}
}
```
But this does not work: all values are "out of range":
```
option = {
"series": [
{
"encode": {
"itemId": 0,
"itemName": 0,
"value": "value",
"y": "value",
"x": "rowID"
},
"type": "bar",
"color": "#1f77b4"
}
],
"dataset": {
"dimensions": [
"rowID",
"value",
"id2"
],
source: [
["A", 1087,"A" ],
[ "B", 244,"B" ],
[ "C", 653,"C" ],
]
},
"xAxis": {
"type": "category",
},
"yAxis": {
"type": "value"
},
"visualMap": {
"id": "highlighter",
"type": "piecewise",
"show": false,
dimension: 0,
"categories": [
"C"
],
"inRange": {},
"outOfRange": {
"opacity": 0.4
}
}
}
```
### What is expected?
The outputs from each of these options should show 1 highlighted bar
### What is actually happening?
The third option , using dimension 0, does nothing. Same behaviour when
using the dimension name rather than dimension offset.
---
Want to be able to track when a particular category is "selected" by the
user. This "selection" may occur through clicking on the series, or through
other activity on the page.
<!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
<!-- This issue is in English. DO NOT REMOVE -->
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]