Version
4.9.0
Steps to reproduce
Examples - Apache ECharts (incubating)
Error when using dimension: 0 in area-category: undefined coord.Other dimension no error.
But both can not draw area, just draw symbol.
option = {
dataset: {
source:[
["x", "y", "z", "t"],
["2019-10-10", 200, 700, "a"],
["2019-10-11", 400, 600, "a"],
["2019-10-12", 650, 500, "a"],
["2019-10-13", 500, 400, "a"],
["2019-10-14", 250, 300, "a"],
["2019-10-15", 300, 200, "a"],
["2019-10-16", 450, 300, "b"],
["2019-10-17", 300, 400, "a"],
["2019-10-18", 100, 500, "a"],
],
},
xAxis: {
type: 'category',
},
yAxis: {
type: 'value',
},
visualMap: {
type: "piecewise",
top: 10,
left: 10,
// dimension: 3,
dimension: 0,
seriesIndex: 0,
show: true,
// categories: ["a", "b"],
categories: ["1", "2"],
// categories: ["2019-10-10", "2019-10-11"],
inRange: {
color: ["blue", "gold"],
},
outOfRange: {
color: "red",
},
},
series: [
{
type: 'line',
smooth: 0.6,
lineStyle: {
color: 'green',
width: 5
},
areaStyle: {},
encode: {
x: 0,
y: 1,
},
}
]
};
What is expected?
draw area with color
What is actually happening?
undefined error, and just draw symbol
In LineView.js, visualMeta.stops
is empty when using dimension: 0.
But, pieces draw well.
6条答案
按热度按时间rta7y2nd1#
Hi! We've received your issue and please be patient to get responded. 🎉
The average response time is expected to be within one day for weekdays.
In the meanwhile, please make sure that you have posted enough image to demo your request. You may also check out the API and chart option to get the answer.
If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org . Please attach the issue link if it's a technical questions.
If you are interested in the project, you may also subscribe our mail list .
Have a nice day! 🍵
dxpyg8gm2#
It seems to be a bug.
gpfsuwkq3#
This issue is labeled with
difficulty: easy
.@czzonet If you are interested in fixing it by yourself, which is a quicker way to get your problem fixed, please have a look at How to debug ECharts if you'd like to give a try. Or you may wait for the community to fix.
rur96b6h4#
Hi, I'd like to fix this issue.
avkwfej45#
It causes serious problem, please fix this, thx. @Ovilia
ERROR TypeError: Cannot read properties of undefined (reading 'coord')
at getVisualGradient (LineView.js:213:1)
option = {
"color": ["#3fb1e3", "#6be6c1", "#626c91", "#a0a7e6", "#33b86c", "#96dee8"],
"dataset": {
"source": [
{ "time": "2022-07-11 10:54:07.000", "soil_permitivity": 9.29 },
{ "time": "2022-07-11 11:08:43.000", "soil_permitivity": 9.58 },
{ "time": "2022-07-11 11:23:35.000", "soil_permitivity": 9.39 },
{ "time": "2022-07-11 11:38:12.000", "soil_permitivity": 9.27 }
]
},
"series": [
{
"type": "line",
"encode": { "x": "time", "y": "soil_permitivity" },
"name": "soil_permitivity",
"symbol": "none",
"markLine": {
"silent": true,
"lineStyle": { "color": "red" },
"data": [{ "yAxis": 9.57, "label": { "position": "insideEndBottom" } }]
}
}
],
"title": {
"textStyle": { "color": "#aaa", "fontSize": 14 },
"left": "center"
},
"tooltip": {
"trigger": "axis",
"axisPointer": {
"type": "cross",
"label": { "backgroundColor": "#6a7985" }
}
},
"xAxis": {
"type": "category",
"boundaryGap": false,
"axisLine": { "lineStyle": { "color": "#efefef" } },
"nameTextStyle": { "color": "#9a9a9a" },
"axisTick": { "show": false },
"axisLabel": { "color": "#9a9a9a" }
},
"yAxis": {
"type": "value",
"axisLine": { "lineStyle": { "color": "#efefef" } },
"nameTextStyle": { "color": "#9a9a9a" },
"axisTick": { "show": false },
"axisLabel": { "color": "#9a9a9a" },
"splitLine": { "show": true, "lineStyle": { "width": 1, "type": "dash" } },
"min": 9.27
},
"grid": {
"show": false,
"top": 20,
"bottom": 2,
"left": 45,
"right": 22,
"containLabel": true
},
"visualMap": {
"type": "piecewise",
"show": false,
"outOfRange": { "color": "#3fb1e3" },
"pieces": [
{ "color": "red", "lte": 9.57 },
]
}
}
qf9go6mv6#
it is indeed a bug, duplicate of #18268 and others - piecewise does not like single pieces.
Workaround is to add a second (fake) piece like
pieces: [{ color: 'red', lte: 9.57 }, {color:'blue', gt: 9999}]