Jqgrid jq绘图-获取线性x轴刻度
我有一个jqPlot图表,如下图所示 Iam使用x轴的LinearAxis渲染器 但是x轴的值是0、1、1、2、2等等 是否有办法获得0、1、2、3等值 提前谢谢 代码:Jqgrid jq绘图-获取线性x轴刻度,jqgrid,jqplot,Jqgrid,Jqplot,我有一个jqPlot图表,如下图所示 Iam使用x轴的LinearAxis渲染器 但是x轴的值是0、1、1、2、2等等 是否有办法获得0、1、2、3等值 提前谢谢 代码: $.jqplot(ctrlId, [graphPt], { title: chartTitle, seriesDefaults: { renderer: $.jqplot.BarRenderer, pointLabels: { show: tr
$.jqplot(ctrlId, [graphPt], {
title: chartTitle,
seriesDefaults: {
renderer: $.jqplot.BarRenderer,
pointLabels: { show: true, location: 'e', edgeTolerance: -15, formatString: '%s' },
shadow: false,
rendererOptions: {
barDirection: 'horizontal',
barMargin: 2
}
},
axesDefaults: {
renderer: $.jqplot.canvasAxisTickRenderer,
min: 0, // minimum numerical value of the axis. Determined automatically.
pad: 1.3, // a factor multiplied by the data range on the axis to give the
// axis range so that data points don't fall on the edges of the axis.
tickOptions: {
mark: 'outside', // Where to put the tick mark on the axis 'outside', 'inside' or 'cross',
markSize: 95, //
showGridline: false, // wether to draw a gridline (across the whole grid) at this tick,
show: true, // wether to show the tick (mark and label),
showLabel: true, // wether to show the text label at the tick,
formatString: '%d' // format string to use with the axis tick formatter
},
showTicks: true, // wether or not to show the tick labels,
showTickMarks: true // wether or not to show the tick marks
},
axes: {
yaxis: {
renderer: $.jqplot.CategoryAxisRenderer
},
xaxis: {
renderer: $.jqplot.LinearAxisRenderer,
tickOptions: {
mark: 'cross',
markSize: 2
}
}
}
});
将
tickinterval
属性添加到xaxis
设置中
xaxis: {
renderer: $.jqplot.LinearAxisRenderer,
tickOptions: {
mark: 'cross',
markSize: 2,
},
tickInterval: 1 //ADD THIS
}
从:
滴答声间隔-滴答声之间的单位数。与numberTicks互斥。将
tickinterval
属性添加到xaxis
设置中
xaxis: {
renderer: $.jqplot.LinearAxisRenderer,
tickOptions: {
mark: 'cross',
markSize: 2,
},
tickInterval: 1 //ADD THIS
}
从:
滴答声间隔-滴答声之间的单位数。与numberTicks互斥。不要忘记添加“max”和“min”属性。如果您正在单独操作xaxis刻度。我在这件事上浪费了很多时间
xaxis: {
renderer: $.jqplot.LinearAxisRenderer,
tickOptions: {
mark: 'cross',
markSize: 2,
},
tickInterval: 1
max :0,
min :100
}
不要忘记添加“最大”和“最小”属性。如果您正在单独操作xaxis刻度。我在这件事上浪费了很多时间
xaxis: {
renderer: $.jqplot.LinearAxisRenderer,
tickOptions: {
mark: 'cross',
markSize: 2,
},
tickInterval: 1
max :0,
min :100
}