cedmans
cedmans

Reputation: 302

jqplot bar chart ticks are bunched up

This is my first experience with jqplot, so I may have missed something obvious.

I'm trying to build a bar chart, but the fields are getting bunched up on the left instead of being spread out nicely, as a bar chart should look.

Here's the simplified code of what I'm trying to accomplish:

    var s1 = [
        0, 1, 2, 3
    ];
    var ticks = [
        'a', 'b', 'c', 'd'
    ];

    plot1 = $.jqplot('chart', [s1], {
        seriesDefaults: {
            renderer: $.jqplot.BarRenderer,
            pointLabels: { show: true }
        },
        axes: {
            xaxis: {
                renderer: $.jqplot.CategoryAxisRenderer,
                ticks: ticks
            }
        }
    });

Applicable simplified JSFiddle: http://jsfiddle.net/Lvu67/

What am I missing here to make this chart show up correctly?

Upvotes: 0

Views: 707

Answers (1)

Gyandeep
Gyandeep

Reputation: 13538

It works it just you forgot to include the jqplot.CategoryAxisRenderer.js file to your code

Jsfiddle Link

Upvotes: 2

Related Questions