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

  • Home
  • SEARCH
  • 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 7915227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:23:14+00:00 2026-06-03T14:23:14+00:00

I have this JPGraph (with proper data): // Create the graph. These two calls

  • 0

I have this JPGraph (with proper data):

// Create the graph. These two calls are always required
$graph = new Graph(640,350,"auto");
$graph->SetScale("textlin");
$graph->SetY2Scale("lin",0,100);

// Create the bar graph
$bplot1 = new BarPlot($datay);
$bplot1->SetFillGradient("darkolivegreen1","darkolivegreen4",GRAD_VERT);
$bplot1->SetWeight(0);
$graph->Add($bplot1);

// Create the line graph
$lplot = new LinePlot($datay2);
$lplot->SetBarCenter();
$lplot->SetStepStyle();
$graph->AddY2($lplot);

// Display the graph
$graph->Stroke();

This works fine (at least it shows the correct data) but my problem is that the Y2 data is behind the bars. I want the Y2 data in front so the data can be shown with a light opacity and I can see how many percent it is.

I have tried rearranging the code so the AddY2 came first or last and even mixed it, but still the same – always behind the bars.

Anyone having any insights on this?

If this is not doable, what is the alternative then – any other free graph tools out there that works just as great as JPGraph (I use CentOS and PHP)?

  • 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-03T14:23:15+00:00Added an answer on June 3, 2026 at 2:23 pm

    If I understand what you are looking to achieve … Try flipping around the Y scales.

    $graph->Add($bplot1); to $graph->AddY2($bplot1);

    and

    $graph->AddY2($lplot); becomes $graph->Add($lplot);

    EDIT:

    As I misunderstood… Add $graph->SetY2OrderBack(false); will place Y2 on the foreground of Y1.
    Source: docs/classref/Graph.html#_GRAPH_SETY2ORDERBACK

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

Sidebar

Related Questions

Have have this line of code in my form when I create a new
I have this Fiddle: http://jsfiddle.net/GSA5R/2/ Whereby i use the border property to create the
I have this xml response to which I will do a foreach($response->entry->item as $data)
I have this batch file to export two files from svn. But it never
I have this code. And basically this returns the correct data without the town
Have this objects and table types: CREATE TYPE Person_typ AS OBJECT ( name CHAR(20),
I have this code which extracts data from a csv file and then reformats
I have this code- <?php $json = 'Two large sardines are seasoned and grilled,
Have this query: SELECT HOUR( DATE ) AS hr, COUNT( * ) AS cnt
Have this self-made slider: http://jsfiddle.net/wyc3P/4/ What it does: takes min and max values in

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.