Question

I am using the jquery jqplot plugin. I have an issue about setting tickInterval. I would like to show X axis values between 10:00 and 12:00 by one minute difference such as 10:01, 10:02, 10:03,...,11:59. For this purpose, I've written this code.

var data = [['10:55', 578.55], ['11:02', 566.5], ['11:04', 480.88], ['11:08', 509.84],
                      ['11:12', 454.13], ['11:22', 379.75], ['11:33', 303], ['11:39', 308.56],
                      ['11:41', 299.14], ['11:52', 346.51], ['11:54', 325.99], ['11:56', 386.15]];
        var plot1 = $.jqplot('chart1', [data], {
            title: 'Average Response Time Graphic - Last One Hour By Minute',
            axes: {
                labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
                labelOptions:{
                    fontFamily:'Helvetica',
                    fontSize: '14pt'
                },
                xaxis: {
                    label : "Time",
                    renderer: $.jqplot.DateAxisRenderer,
                    tickRenderer: $.jqplot.CanvasAxisTickRenderer,
                    <!--tickOptions:{formatString:'%d.%m.%y %H:%M:%S', angle: -30},-->
                    tickOptions: {
                        formatString:'%H:%M:%S', 
                        angle: -30,
                        tickInterval : '1 minute'
                        <!--tickInterval : '60000' -->
                    },

                    <!--min: '2013-02-05 10:50', -->
                    min: '10:00',
                    max: '12:00'
                },
                yaxis: {
                    label: "Average Response Time",
                    tickOptions: {
                        formatString: '$%.2f'
                    }
                }
            },
            highlighter: {
                show: true,
                sizeAdjust: 7.5
            },
            cursor: {
                show: false
            }
        });

However, this code doesnt work very well since there is 10 minute difference between x axis values between 10:00 and 12:00. By the way, I've added all jqplot plugin files not to cause wrong evaluation of javascript.

I've looked at this issue jqPlot DateAxis tickInterval not working and tried the first answer, however it doesnt work, too.

Is there anyone who may help me to solve this problem? Thanks in advance,

Best regards.

Was it helpful?

Solution

I've found the solution! It worked when I remove tickInterval from tickOptions and put under xaxis !

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top