Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9019913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:53:00+00:00 2026-06-16T04:53:00+00:00

I am making a graph where I need little help. (I have googled so

  • 0

I am making a graph where I need little help. (I have googled so much but can’t succeed thats why asking. – If possible duplicate I apologize.) enter image description here

My Code:

var plot2 = $.jqplot('distance_graph', data.distance, {
                // The "seriesDefaults" option is an options object that will
                // be applied to all series in the chart.
                seriesDefaults:{
                    renderer:$.jqplot.BarRenderer,
                    rendererOptions: {fillToZero: false},
                    pointLabels: { show: true },
                },
                // Custom labels for the series are specified with the "label"
                // option on the series option.  Here a series option object
                // is specified for each series.

                // Show the legend and put it outside the grid, but inside the
                // plot container, shrinking the grid to accomodate the legend.
                // A value of "outside" would not shrink the grid and allow
                // the legend to overflow the container.
                legend: {
                    show: true,
                    placement: 'outsideGrid'
                },
                axes: {
                    // Use a category axis on the x axis and use our custom ticks.
                    xaxis: {
                        renderer: $.jqplot.CategoryAxisRenderer,
                        label: 'Date',
                        ticks: ticks,
                        labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
                        tickRenderer: $.jqplot.CanvasAxisTickRenderer,
                        tickOptions: {
                            angle: -30
                        }
                    },
                    // Pad the y axis just a little so bars can get close to, but
                    // not touch, the grid boundaries.  1.2 is the default padding.
                    yaxis: {
                        label: 'Distance Travelled',
                        pad: 1.05,
                        labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
                        tickRenderer: $.jqplot.CanvasAxisTickRenderer,
                        tickOptions: {
                          labelPosition:'middle'
                        },
                        min:min_val,
                        max:max_val     
                    }
                }
            });
        plot2.legend.labels = data.device;
        plot2.replot( { resetAxes: false } );

and How can I remove 0 values also, Because I am converting this chart to multiple Item’s chart. This is currently One Item’s Chart.. So How to remove 0 labels also…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:53:01+00:00Added an answer on June 16, 2026 at 4:53 am

    Based on these examples: point-labels, you can modify the display of point labels using .jqplot-point-label class in your CSS. Therefore, you can use CSS transform property to rotate the text as described here: how-to-draw-vertical-text-with-css-cross-browser

    To remove labels for 0 values, you need to provide a set of labels with zeros changed to empty strings. You can use this custom set like this:

    pointLabels: {
        show: true,
        labels: customSetOfLabels
    },
    

    Here’s a working demo – however, it looks like jqPlot blocks requests from jsfiddle so sometimes the scripts don’t load. You can either try locally or visit the jqPlot demo page and the jsfiddle in one browser window so the scripts are loaded from cache.

    I used a JavaScript array map() function to create the custom set of labels like this:

    function removeZeros(x){
        return x===0 ? '' : x;
    }
    var line1 = [14, 32, 41, 44, 0, 40];
    var line1Labels = line1.map(removeZeros);
    

    Please note that map() might not work in all browsers so you might want to iterate over the array using a for loop instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a graph-related program so I need to dynamically create/remove columns from a
HI i am in desperate need for help here, I am making a web
I am making a graph and need to generate an array from the information
I was wondering how (if possible) I can go about making an adjacency list
I am making a graph in ggplot2 consisting of a set of datapoints plotted
I am making an interactive graph using reportlab. Each bar in the graph is
I'm thinking of making an application where at some points a graph is displayed
Making a new site but something is happening to it in IE8. The social
Making a word document of our network set-up. We have about 7 servers and
Making a new site but something is happening to it in IE. I've purchased

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.