Question

I am using a jqplot plugin to get customised bar graph for my website. The labels in bar graph [ticks] should be rotated at an angle of -30deg in the x axis with some custom names. could some please guide me how to make possible.

Here is the below Jqplot Code i have used

      $(document).ready(function(){
      var s1 = [2, 6, 7, 10];
     var s2 = [7, 5, 3, 2];
     var s3 = [14, 9, 3, 8];
     plot3 = $.jqplot('chart3', [s1, s2, s3], {
        stackSeries: true,
        captureRightClick: true,
        seriesDefaults:{
            renderer:$.jqplot.BarRenderer,
            rendererOptions: {
                highlightMouseDown: true   
            },
            pointLabels: {show: true}
        },
        legend: {
            show: true,
            location: 'e',
            placement: 'outside'
        }      
    });

         $('#chart3').bind('jqplotDataRightClick', 
        function (ev, seriesIndex, pointIndex, data) {
            $('#info3').html('series: '+seriesIndex+', point: '+pointIndex+', data: '+data);
        }
    ); 
        });

No correct solution

OTHER TIPS

Look into this

jQplot has a built in feature

http://www.jqplot.com/tests/rotated-tick-labels.php

First, include this plugin:

<script type="text/javascript" src="your path/plugins/jqplot.canvasAxisTickRenderer.min.js"></script>

then add this to your options.

xaxis: {

        tickRenderer: $.jqplot.CanvasAxisTickRenderer ,
        tickOptions: {
            angle: -30,
        }
       },
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top