有谁知道如何让“y轴”值从0开始在Jqplot ....默认情况下它以负值开始,例如:-500,0 ,500,1000等....请帮助JQplot barRenderer“y轴”值从负值开始
回答
参见http://www.jqplot.com/docs/files/jqPlotOptions-txt.html
组y轴:{分钟:0,最大:500,numberTicks:5}
集分钟:对象(最小)设为0:对象
$(document).ready(function(){
// your code here... //
axes:{
yaxis: {min:0}
}
})
正如rsapru建议的那样,建议使用max:object(maximum)值将图形绑定到您的首选范围。例如,如果你想最低为0,最高为7500
axes:{
yaxis: {min:0, max: 7500}
}
如果你想通过与蜱指定蜱可指定您可以手动刻度线的刻度:对象或具有jqPlot计算滴答间距(在这种情况下不需要除最小和最大物体以外)或按特定的滴答数量(使用numberTicks:对象)
示例:对于间隔100单位,从0到1000,使用11蜱(0,100,200,300,400,500,600,700,800,900,1000)jqPlot自动计算:
axes:{
yaxis: {min:0, max: 1000, numberTicks: 11}
}
示例:对于蜱100个单位分开,从0到1000,使用11个蜱(0,100,200,300,400,500,600,700,800,900,1000)手册规范:
axes:{
yaxis: {min:0, max: 1000, Ticks: [[0],[100],[200],[300],[400],[500],[600],[700],[800],[900],[1000]]}
}
你可以告诉任何方法来计算没有滴答滴答,没有明确地设置它,我的意思是,如果图表正常创建,那么我们可以得到图中显示的滴答否 – 2013-05-27 13:24:49
你能帮助这个one:http://stackoverflow.com/q/16771537/1283215 – 2013-05-27 13:25:53
你可能必须结合Nerds的技术的答案与PackedUp的答案迫使一个零y轴“realsies”,就像这样:'轴:{yaxis:{min :0,pad:0}}' – 2014-02-03 20:16:47
var plot2 = $.jqplot ('chartdiv', getRequestStats(), {
// Give the plot a title.
title: 'Daily Request Status',
// You can specify options for all axes on the plot at once with
// the axesDefaults object. Here, we're using a canvas renderer
// to draw the axis label which allows rotated text.
axesDefaults: {
labelRenderer: $.jqplot.CanvasAxisLabelRenderer
},
// An axes object holds options for all axes.
// Allowable axes are xaxis, x2axis, yaxis, y2axis, y3axis, ...
// Up to 9 y axes are supported.
axes: {
// options for each axis are specified in seperate option objects.
xaxis: {
label: "Hour",
// Turn off "padding". This will allow data point to lie on the
// edges of the grid. Default padding is 1.2 and will keep all
// points inside the bounds of the grid.
pad: 0
},
yaxis: {
label: "Count",
pad: 0
}
}
});
垫:0将星Y轴从0开始。
以下解决方案适用于我。
- >在数组中也添加零值。
- >设置数据渲染到$ .jqplot.CanvasAxisLabelRenderer
y轴:{ 渲染:$ .jqplot.CanvasAxisLabelRenderer .....
}
感谢 阿德南
在yaxis中添加yaxis:{min:0}
将以下内容添加到脚本中:
yaxis: {
minimum:0
}
在你的yaxis。我试了一下,它的工作原理。
- 1. 格式Y轴蜱jqplot /值
- 2. JQPlot BarRenderer期不与图轴对齐
- 3. Jqplot y轴值为KB/MB/TB/PB
- 4. jqPlot - Y轴上的时间值
- 5. 图表js 2中如何从右侧开始Y轴线为负值?
- 6. 用jqplot在y轴上映射数值输入值
- 7. 以负数查看Y轴最小值
- 8. 从jqplot中删除x和y轴线
- 9. jQPlot:设置Y轴编号
- 10. ASP.NET图表 - Y值不从0开始
- 11. 背景颜色从y轴开始?
- 12. PChart - Y轴不从0开始
- 13. JqPlot修剪X轴值
- 14. SSRS使报告从负值开始
- 15. jQplot日期轴图开始点
- 16. 将Y轴最小值设置为负值不起作用
- 17. 如何将y轴的值仅显示在jqplot中
- 18. 如何在Jqplot中获取Y轴的整数值?
- 19. 在缩放JQplot图表时,将y轴值整数
- 20. X轴和Y轴从d3js的边缘开始切割
- 21. jqplot从顶部开始绘制轴标记
- 22. jqplot tooltipContentEditor显示错误x和y值
- 23. 我如何修复Y轴在jqplot
- 24. jqPlot造型 - 如何删除Y轴线?
- 25. jqplot y轴文本高度已剪辑
- 26. jqplot y轴标签不是垂直的
- 27. JQPlot - 使y轴只有整数?
- 28. JQPlot Y轴标签偏移量
- 29. 在jqPlot中,如何去除y轴线?
- 30. jqPlot对齐不同y轴的零点
谢谢大家:) – soniaP 2011-07-07 15:08:53