[英]JQPLOT bar graph range
I have created a dynamic bar graph using jqplot, the problem is that some values are quite big ie 10000000 and others are pretty small ie 2000 or 10000. Because of this range issue, i am only able to see the bigger valued graphs while the rest dont even appear up or appear as just a line on the axis. 我用jqplot创建了一个动态条形图,问题是有些值非常大,即10000000而其他值非常小,即2000或10000.由于这个范围问题,我只能看到更大的有价值的图,而其余的甚至不会出现或显示为轴上的一条线。
Could someone please let me know how this range issue could be solved? 有人可以告诉我这个范围问题怎么解决?
Following my comment, and your need to achieve a solution which includes jqplot bar chart, i'll suggest illustrating the massive difference of values by adding a second line graph to the plot. 根据我的评论,以及您需要实现包含jqplot条形图的解决方案,我建议通过在绘图中添加第二个折线图来说明值的巨大差异。
$(document).ready(function(){
var data = [10000000, 5000000,10000,2000];
var options= {
title: 'Bar and Line Chart',
series:[{
renderer: $.jqplot.BarRenderer,
rendererOptions: {
barMargin: 5,
fillToZero: true
},
pointLabels: {
show: true,
seriesLabelIndex:1,
hideZeros:false
}
}],
axes: {
xaxis: {
tickRenderer: $.jqplot.CanvasAxisTickRenderer,
renderer: $.jqplot.CategoryAxisRenderer,
},
yaxis: {
labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
padMin: 0,
pad: 1.1,
label: ' logarithmic scale',
rendererOptions: { forceTickAt0: true}
}
},
};
$.jqplot('graph', [data,data], options );
});
Here is a working solution in jsfiddle 这是jsfiddle中的一个有效解决方案
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.