Solved

jqplot y-axis

Posted on 2014-12-22
1
395 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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
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…

762 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

8 Experts available now in Live!

Get 1:1 Help Now