jqplot: Separating ticks and series values

前端 未结 2 424

I have a web service that sends date values (for x-axis) in one array. It sends y-axis values in another array.

Is it possible to have jqPlot create a chart with 2

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-14 23:02

    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.

提交回复
热议问题