Mortalus
Mortalus

Reputation: 10712

jqPlot not plotting using dates

I try to plot a trend line chart using jqu Plot:

$(document).ready(function ()
    {
        var line1 = [['2012-01-01', 578.55], ['2012-01-02', 566.5], ['2012-01-03', 480.88], ['2012-01-04', 509.84]];

        var plot1 = $.jqplot('TrendChart', [line1], {
            title: 'Data Point Highlighting',
            axes: {
                xaxis: { renderer: $.jqplot.DateAxisRenderer, tickOptions: { formatString: '%b %#d'} },
                yaxis: { tickOptions: { formatString: '$%.2f' } }
            },
            highlighter: { show: true, sizeAdjust: 7.5 },
            cursor: { show: false }
        });
    });

The page loads with a graph but there is not line with the corresponding values... what am I doing wrong this is almost the exact example from the docs.

Upvotes: 0

Views: 253

Answers (1)

AnthonyLeGovic
AnthonyLeGovic

Reputation: 2335

Don't forget to include jqplot.dateAxisRenderer.js plugins

Upvotes: 1

Related Questions