Solved

jqplot y-axis

Posted on 2014-12-22
1
407 Views
Last Modified: 2014-12-22
Is it possible to remove the y-axis from the top two jqplot jqplot chartcharts without affecting the x-axis?


Below is my code
$(document).ready(function(){  

//------------------------------------------Quadrant 1 (Top Left)
    var s2 = [200, 600, 700, 350];
    var ticks = ['>15', '11-15', '6-10', '0-5'];
     
    var plot2 = $.jqplot('testTarget2', [s2], {
        seriesDefaults:{
            renderer:$.jqplot.BarRenderer,
            rendererOptions: {fillToZero: true},
             pointLabels: {show: true}
        },
        series:[
            {label:'Airfare'}
        ],
            axesDefaults: {
        		showTicks: true,
        		showTickMarks: true       
    	},
        
        axes: {
            // Use a category axis on the x axis and use our custom ticks.
            xaxis: {
                renderer: $.jqplot.CategoryAxisRenderer,
                ticks: ticks
            },

    });


//------------------------------------------Quadrant 2 (Top Right)
    var s4 = [200, 600, 700, 350];
    var ticks = ['1-5', '6-10', '11-15', '>15'];
     
    var plot4 = $.jqplot('testTarget4', [s4], {
        seriesDefaults:{
            renderer:$.jqplot.BarRenderer,
            rendererOptions: {fillToZero: true},
             pointLabels: {show: true}
        },
        series:[
            {label:'Airfare'}
        ],          axesDefaults: {
        		showTicks: true,
        		showTickMarks: true       
    	},

        axes: {
            // Use a category axis on the x axis and use our custom ticks.
            xaxis: {
                renderer: $.jqplot.CategoryAxisRenderer,
                ticks: ticks
            }
        }
    });


//------------------------------------------Quadrant 3 (Bottom left)
    var s1 = [-700, -600, -250, -1000];
    var ticks = ['May', 'June', 'July', 'August'];
     
    var plot1 = $.jqplot('testTarget', [s1], {
        // The "seriesDefaults" option is an options object that will
        // be applied to all series in the chart.
        seriesDefaults:{
            renderer:$.jqplot.BarRenderer,
            rendererOptions: {fillToZero: true},
             pointLabels: {show: true}
        },
        series:[
            {label:'Airfare'}
        ],     
        axesDefaults: {
        showTicks: false,
        showTickMarks: false       
    },
        
        axes: {
            // Use a category axis on the x axis and use our custom ticks.
            xaxis: {
                renderer: $.jqplot.CategoryAxisRenderer,
                ticks: ticks
            },
        }
    });

//------------------------------------------Quadrant 4 (bottom right)
 var s3 = [-700, -600, -250, -1000];
    var plot3 = $.jqplot('testTarget3', [s3], {
        // The "seriesDefaults" option is an options object that will
        // be applied to all series in the chart.
        seriesDefaults:{
            renderer:$.jqplot.BarRenderer,
            rendererOptions: {fillToZero: true},
             pointLabels: {show: true}
        },
        series:[
           // {label:'Hotel'},
           // {label:'Event Regristration'},
            {label:'Airfare'}
        ],

            axesDefaults: {
        showTicks: false,
        showTickMarks: false       
    },

        axes: {
            // Use a category axis on the x axis and use our custom ticks.
            xaxis: {
                renderer: $.jqplot.CategoryAxisRenderer,
                ticks: ticks
            }

        }
    });


});

Open in new window


Here's the link to the actual page: jqplot 4 quadrant Chart
0
Comment
Question by:Isaac
1 Comment
 
LVL 51

Accepted Solution

by:
HainKurt earned 500 total points
ID: 40513437
something like this should work...

axes: {
        xaxis: {
            // same options as axesDefaults
        },
        yaxis: {
            // same options as axesDefaults
            showTicks: false,        // wether or not to show the tick labels,
            showTickMarks: false,    // wether or not to show the tick marks
        }

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now