Jqplot图形中最后一个条形图的情况

Jqplot situation with the last bar in the graph

本文关键字:情况 条形图 最后一个 图形 Jqplot      更新时间:2023-09-26

情况

我试图在最后的xaxis选项上留出一些空间。

例如:

xaxis. min:-max:6
  • 只显示最后一个栏的一半,如果我尝试使用tickOption,它不会出现,因为它在画布之外

代码:http://jsfiddle.net/chalien/zEQe7/

感谢

您的数组设置不适合条形图。你不需要告诉渲染的情节,它是点编号1、2、3等……它自己就知道。

只需将数组定义更改为:

 [[4, 6, 2, 5, 6]]

无论是否使用minmax定义,图形都将正确渲染。

这是完整的代码:

<script type="text/javascript">
$.jqplot('chart2',  [[4, 6, 2, 5, 6]],
{ title:'Exponential Line',
      seriesDefaults: {
            renderer: $.jqplot.BarRenderer,
            rendererOptions: {
                varyBarColor: true  
            }
        },
   axes: {
            xaxis: {  
               max:6,
               min:0,
                renderer: $.jqplot.LinearAxisRenderer
            }
        }
});
 </script>