开发者

How do I have more columns than data points in a jqplot barchart and have the trendline continue over all columns?

In jqPlot, I define an array with the data series and an array with the tick/column labels. If I have more ticks/columns than data points in the series and have trendline turned on, the trendline only continues over the domain of the data points, not over all columns. Is there any way to allow the trendline to continue and extrapolate over the whole domain?

For instance, if I try this data with these ticks:

var s1 = [40, 50, 55, 57, 64];
var ticks = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];

The bars display a little funky, but the trendline is correct, but 开发者_高级运维only for the 5 data points. Alternately, this data with the same ticks:

var s1 = [40, 50, 55, 57, 64, 0, 0, 0, 0, 0, 0, 0];

Has a trendline that nose-dives, which doesn't really describe the trend of the data before the 0's. Nulls or undefined don't seem to work (instead of 0's) for the remaining columns either.

So, what do I need to do to show partial data across the domain (the year) and still get an accurate trend/extrapolation line?


Pass null to it or an empty value [1,2,3... AFAIK

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜