jqplot: Separating ticks and series values

非 Y 不嫁゛ 提交于 2019-12-01 11:05:39

I can not figure out a way for jqPlot to accept how you want to define your inputs (the ticks option seems to only work with numbers). I'm curious as to the "avoid the extra processing" comment. With jQuery it would be as easy as:

$.map(dateValues, 
       function(val,idx){
           return [[val,dailyValues[idx]]];
       }
);

to "merge" the two arrays into point pairs.

Subhash Chandra Medhi

The 'multiple ticks for the same date' for the date-axis can be solved by including the following code snippet:

  xaxis: {
           label: "Whatever you name it",
           renderer: $.jqplot.DateAxisRenderer,
           min:dateVal[0],
           max:dateVal[dateVal.length-1],
           tickInterval: '1 day',

Please include min,max and tickInterval under xaxis: and not under tickOptions: .

In my case I am having the date values in the array dateVal where the 0th element is the minimum value of date for the x-axis and the last element is the max date value. If you so wish you could hard-code the date values.

I hope this will be of help.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!