admin管理员组文章数量:1425657
I want to remove tick values (3.5, 3.0, 2.5, 2.0, 1.5, 1.0, 0.5, 0.0) along y-axis. For more information please see below picture. If can not remove then there must be some option to change the color. I will make it transparent.
var data = [{data: [[0,1]], color: "red"},
{data: [[1,2]], color: "yellow"},
{data: [[2,3]], color: "green"}];
$.plot("#placeholder",data, {
series: {
bars: {
show: true,
barWidth: 0.3,
align: "center",
lineWidth: 0,
fill:.75
}
},
xaxis: {
ticks: [[0,"Red"],[1,"Yellow"],[2,"Green"]]
}
});
Here is the example I am following for this: /
I want to remove tick values (3.5, 3.0, 2.5, 2.0, 1.5, 1.0, 0.5, 0.0) along y-axis. For more information please see below picture. If can not remove then there must be some option to change the color. I will make it transparent.
var data = [{data: [[0,1]], color: "red"},
{data: [[1,2]], color: "yellow"},
{data: [[2,3]], color: "green"}];
$.plot("#placeholder",data, {
series: {
bars: {
show: true,
barWidth: 0.3,
align: "center",
lineWidth: 0,
fill:.75
}
},
xaxis: {
ticks: [[0,"Red"],[1,"Yellow"],[2,"Green"]]
}
});
Here is the example I am following for this: http://jsfiddle/TPp8m/
Share Improve this question edited Jan 20, 2016 at 5:44 Amar Singh 5,6223 gold badges29 silver badges55 bronze badges asked Jan 20, 2016 at 5:38 Vikasdeep SinghVikasdeep Singh 21.8k16 gold badges82 silver badges106 bronze badges2 Answers
Reset to default 5You can set yAxis ticks as an array to get only those values, for your question I added
yAxis{
ticks: []
}
Check fiddle
As you said , You just want to hide all y axis values than you can Use $("#placeholder").find(".tickLabel").hide();
and show it again Using:
$("#placeholder").find(".tickLabel").show();
Jsfiddle
本文标签: javascriptFlot chart How to removehide tick values along yaxisStack Overflow
版权声明:本文标题:javascript - Flot chart: How to removehide tick values along y-axis? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745374289a2655868.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论