【发布时间】:2013-11-27 11:42:19
【问题描述】:
我正在 jquery 中使用 dateaxisrender jqplot 绘制图表。 在这里,我们在 x 轴上给出了我们从服务器接收到的日期。
图表绘制得很好,但每个 xtick 之间的差距是不同的。
假设我的 xtciks 日期是:“08-Aug”、“10-Aug”、“01-Sep”、“15-sep”、25-dec。
“8 月 8 日”和“8 月 10 日”之间的差距很小。 “10-Aug”和“01-Sep”之间的差距很大 而“15-sep”和 25-dec 之间的差距更大。
我认为该图表正在考虑日期之间的天数,给出每个日期之间的宽度。 但在我的情况下,它应该是相等的宽度。
有人可以建议我如何紧急解决这个问题吗?
我无法在此处粘贴图表图像。
$.jqplot(grphOneID, [grdPoints], YI.getGraphOpts(grdXTcks, YAxisLbl)).replot();
getGraphOpts: function (XTcks, YAxisLbl) {
/// <summary>Object that holds all the setting's required for Graph generation.</summary>
$.jqplot.config.enablePlugins = true;
var optsObj =
{
axes: {
yaxis: {
ticks: m_CompositeReport.stdYLbls,
label: YAxisLbl,
tickOptions: {
formatString: '%d'
}
},
xaxis: {
renderer: $.jqplot.DateAxisRenderer,
label: 'Shop',
ticks: XTcks,
tickOptions: {
formatString: "%m/%d",
markSize: 4
},
numberTicks: 0,
}
},
seriesColors: m_CompositeReport.stdColors.reverse()
}
return optsObj;
},
注意:我们不能使用 CategoryAxisRender,因为它在行之间绘制 xtick,如下所示:http://jsfiddle.net/JWhmQ/2052/ 但是,我们需要将日期绘制在此处:http://www.jqplot.com/deploy/dist/examples/customHighlighterCursorTrendline.html
【问题讨论】:
-
有人在吗?
标签: jquery asp.net-mvc jquery-plugins jqplot