如何删除Google图表中的彩色线条示例?我的意思是附图中右侧的线条示例
exampleChart.draw(view, {
vAxis: {
viewWindow: {
min: 0
},
viewWindowMode: "explicit"
}
}, {
legends: "none",
curveType: "function",
backgroundColor: "#000",
fontSize: "18",
colors: ["#000"],
series: {
1: {
lineDashStyle: [0, 0]
}
},
lineWidth: 1,
chartArea: {
width: "100%"
});
答案 0 :(得分:1)
您的选项定义中有额外的花括号
导致两个对象而不是一个对象
因此图表仅使用vAxis
定义
{
vAxis: {
viewWindow: {
min: 0
},
viewWindowMode: "explicit"
}
}, { // <-- remove these, add comma above
legend: "none",
curveType: "function",
backgroundColor: "#000",
fontSize: "18",
colors: ["#000"],
series: {
1: {
lineDashStyle: [0, 0]
}
},
lineWidth: 1,
chartArea: {
width: "100%"
});
请参阅以下摘录...
chart.draw(view, {
vAxis: {
viewWindow: {
min: 0
},
viewWindowMode: "explicit"
},
legend: "none",
curveType: "function",
backgroundColor: "rgb(238, 238, 238)",
fontSize: "10",
colors: ["#176bad"],
series: {
1: {
lineDashStyle: [0,0]
}
},
lineWidth: 0,
chartArea: {
width: "100%"
}
});
答案 1 :(得分:0)
请尝试以下脚本,
exampleChart.draw(view, {
vAxis: {
viewWindow: {
min: 0
},
viewWindowMode: "explicit"
}
}, {
legend: "none",
curveType: "function",
backgroundColor: "#000",
fontSize: "18",
colors: ["#000"],
series: {
1: {
lineDashStyle: [0, 0]
}
},
lineWidth: 1,
chartArea: {
width: "100%"
});
答案 2 :(得分:0)
这称为“图例”,可以通过line charts configuration options中指定的设置添加legend: "none"
来删除。