Jqplot - How to have vertical lines and make xaxis go up in plotted values?

Posted by Beginner on Stack Overflow See other posts from Stack Overflow or by Beginner
Published on 2012-12-07T16:36:01Z Indexed on 2012/12/07 17:06 UTC
Read the original article Hit count: 249

Filed under:
|

I have plotted a line graph using jqplot.

What i would like is vertical lines and to start from 3 and go up in the plotted values along the bottom. so 3, 6, 9, 12 , 15, 29, 36 Also a dash marker along the left.

This is what i have at the moment:

$(document).ready(function(){
    $.jqplot('chart2', [[[3, @(Model.LearnerWeek[0])], [6, @(Model.LearnerWeek[1])], [9, @(Model.LearnerWeek[2])],
                       [12, @(Model.LearnerWeek[3])], [15, @(Model.LearnerWeek[4])], [29, @(Model.LearnerWeek[5])], [36, @(Model.LearnerWeek[6])]],
                       [[3, @(Model.ManagerWeek[0])], [6, @(Model.ManagerWeek[1])], [9, @(Model.ManagerWeek[2])],
                       [12, @(Model.ManagerWeek[3])], [15, @(Model.ManagerWeek[4])], [29, @(Model.ManagerWeek[5])], [36, @(Model.ManagerWeek[6])]]],
        {
            axes: {
                yaxis: { tickOptions: { show: false}, min: 0, max: 100, label: 'Participation Rate', labelRenderer: $.jqplot.CanvasAxisLabelRenderer },
                xaxis: { min: 3, max: 36, label: 'Week', tickOptions: { formatString: '%d' } }
            },
            seriesDefaults: {
                showMarker: false ,
                rendererOptions: {
                    diameter: undefined, // diameter of pie, auto computed by default.
                    padding: 10,        // padding between pie and neighboring legend or plot margin.
                    fill: true,         // render solid (filled) slices.
                    shadowOffset: 2,    // offset of the shadow from the chart.
                    shadowDepth: 15,     // Number of strokes to make when drawing shadow.  Each stroke
                    // offset by shadowOffset from the last.
                    shadowAlpha: 1   // Opacity of the shadow
                }
            },
            seriesColors: ['#3591cf', '#ef4058', '#73C774', '#C7754C', '#17BDB8']
    });
});

I have played around with render options and xasis but cant seem to work it out

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jqplot