?
Solved

jqplot y-axis

Posted on 2014-12-22
1
Medium Priority
?
529 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 57

Accepted Solution

by:
HainKurt earned 2000 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

Cloud Training Guides

FREE GUIDES: In-depth and hand-crafted Linux, AWS, OpenStack, DevOps, Azure, and Cloud training guides created by Linux Academy instructors and the community.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…
Suggested Courses

752 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