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 8312263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:06:24+00:00 2026-06-08T20:06:24+00:00

I have created a graph using jpgraph – it works however due to the

  • 0

I have created a graph using jpgraph – it works however due to the length of the labels on my x-axis some of text is being ‘cut-off’ an isn’t visible. I have created a custom function to use the newline but even with this it still trims off a few characters on one of the labels on the chart.

Is there a method to actual define the actual length of the x-axis labels eg set a width in pixels? Thanks

        // Create the graph. These two calls are always required
    $graph = new Graph(1000,500,'auto');
    $graph->SetScale("textlin");

    //$theme_class="DefaultTheme";
    //$graph->SetTheme(new $theme_class());

    // set major and minor tick positions manually
    $graph->yaxis->SetTickPositions(array(0,1,2,3,4,5), array(0.5,1.5,2.5,3.5,4.5));
    $graph->SetBox(false);

    //$graph->ygrid->SetColor('gray');
    $graph->ygrid->SetFill(false);
    $graph->xaxis->SetLabelAngle(90); // 45 degrees angle
    $graph->xaxis->SetTickLabels($new_labels);
    $graph->yaxis->HideLine(false);
    $graph->yaxis->HideTicks(false,false);

    // Create the bar plots
    $b1plot = new BarPlot($data);

    // ...and add it to the graPH
    $graph->Add($b1plot);        

    $b1plot->SetColor("white");
    $b1plot->SetFillGradient("#4B0082","white",GRAD_LEFT_REFLECTION);
    $b1plot->SetWidth(45);
    $graph->title->Set("Bar Gradient(Left reflection)");

    // Display the graph
    $graph->Stroke();
  • 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-08T20:06:25+00:00Added an answer on June 8, 2026 at 8:06 pm

    Figured out (almost)
    Just in case anyone else needs help use the following:

    $graph->xaxis->SetLabelAlign('right','center','right');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a graph using core plot. Graph is shown in on the
Actually, in my app, I have created a graph using achartEngine . In these
I have a cyclic graph I created using dosync and ref-set . When I
I have some problems with my first Open Graph custom action: I've created a
I have created a graph with one x-axis and two y-axis. The problem is
We have created an invite function at our site in JavaScript using the Graph
I have created a graph using ggplot2. Now I want to have the legend
I have created a horizontal bar graph using gRaphael charting library. I want to
The graph I have created using prefuse (shown below) is too dense! There are
hi i have a graph created from a .csv file using the jquery $.get().

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.