我不能用反转的ya6创建flot bar。
从这一点上讲,这有助于:
transform: function (v) {return -v; },
inverseTransform: function (v) { return -v; }图片就会翻转,例如:http://jsbin.com/eloven/2/editВ。
请帮帮我!
发布于 2012-11-08 19:56:07
解决方案:0- (currentValue - maxValue)
#graph-bars .bar-wrap {
height: 45px;
display: block;
margin: 0 0 10px;
border-bottom: 1px solid #9D9D9C;
position: relative;
}
#graph-bars .bar {
background: #808080;
color: #808080;
width: 50px;
min-height: 5px;
max-height: 100%;
position: absolute;
bottom: 0;
left: 20%;
}
Array.max = function( array ) {
return Math.max.apply( Math, array );
};
for(...) {// i -counter
var max = Array.max(years[lastYear]);
var height = 0 - (years[lastYear][i] - max); // 0 - (currentValue - maxValue)
$('#graph-bars').append("<span class='bar-wrap'><span class='bar' style='height:"+ height +"%'></span>");
}发布于 2012-11-06 14:55:35
如果这就是您所说的反向y轴(11,10,9 ... 1),
xaxis: {
transform: function(v) {
return -v;
},
inverseTransform: function(v) {
return -v;
}
},
yaxis: {
show: true,
tickSize: 200
}https://stackoverflow.com/questions/13245729
复制相似问题