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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:45:44+00:00 2026-06-11T10:45:44+00:00

below is my jp graph code include_once (jpgraph/jpgraph.php); include_once (jpgraph/jpgraph_scatter.php); // Some data for

  • 0

below is my jp graph code

            include_once ("jpgraph/jpgraph.php");
            include_once ("jpgraph/jpgraph_scatter.php");

            // Some data for the points
            $datax = array(3.5,13.7,3,4,6.2,6,3.5,8,14,8,11.1,13.7);
            $datay = array(10,22,12,13,17,20,16,19,30,31,40,43);

            // A new scatter graph
            $graph = new Graph(300,200,'auto');
            $graph->SetShadow();
            $graph->SetScale("linlin");

            //$graph->img->SetMargin(40,40,40,40);        

            $graph->title->Set("Scatter plot with Image Map");
            $graph->title->SetFont(FF_FONT1,FS_BOLD);

            // Client side image map targets
            $targ=array("pie_csimex1.php#1","pie_csimex1.php#2","pie_csimex1.php#3",
            "pie_csimex1.php#4","pie_csimex1.php#5","pie_csimex1.php#6",
            "pie_csimex1.php#7","pie_csimex1.php#8","pie_csimex1.php#9" );

            // Strings to put as "alts" (and "title" value)
            $alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d","val=%d","val=%d","val=%d");

            // Create a new scatter plot
            $sp1 = new ScatterPlot($datay,$datax);

            // Use diamonds as markerss
            $sp1->mark->SetType(MARK_DIAMOND);
            $sp1->mark->SetWidth(10);

            // Set the scatter plot image map targets
            $sp1->SetCSIMTargets($targ,$alts);

            // Add the plot
            $graph->Add($sp1);

            // Send back the HTML page which will call this script again
            // to retrieve the image.
            $graph->StrokeCSIM();

above code works fine by displaying the scattered graph… but i want to embed some php code in the same page ,if i do that it does not work…. as per some expert’s advice i replaced
$graph->StrokeCSIM();

with
`$fileName = “./lang/12345.png”;
$graph->img->Stream($fileName);

            echo('<img src="./lang/12345.png" />');`

it creates a file with 12345.png and does not display graph… how can i fix this?

updated question with code….

            $_GET['Variance']=$Variance;
            $_GET['Emp_RecFactor']=$Emp_RecFactor;


            // Some data for the points
            $datax =$Emp_RecFactor;
            $datay =$Variance;



            // A new scatter graph
            $graph = new Graph(600,600);
            $graph->SetScale('intlin',-10,10,0,100);
            $graph->yscale->ticks->Set(1);
            $graph->xscale->ticks->Set(5);

            //$graph->img->SetMargin(40,40,40,40);        

             $graph->xaxis->title->Set("Reco-Factor");
            $graph->yaxis->title->Set("Variance");
            $graph->title->Set("Equity Graph Of All Employees");
            $graph->title->SetFont(FF_FONT1,FS_BOLD);

            // Client side image map targets
            $targ=array("pie_csimex1.php#1","pie_csimex1.php#2","pie_csimex1.php#3",
            "pie_csimex1.php#4","pie_csimex1.php#5","pie_csimex1.php#6",
            "pie_csimex1.php#7","pie_csimex1.php#8","pie_csimex1.php#9" );

            // Strings to put as "alts" (and "title" value)
            $alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d","val=%d","val=%d","val=%d");

            // Create a new scatter plot
            $sp1 = new ScatterPlot($datay,$datax);

            // Use diamonds as markerss
            $sp1->mark->SetType(MARK_DIAMOND);
            $sp1->mark->SetWidth(10);

            // Set the scatter plot image map targets
            $sp1->SetCSIMTargets($targ,$alts);

            // Add the plot
            $graph->Add($sp1);

            // Send back the HTML page which will call this script again
            // to retrieve the image.



            $graph->Strokecsim();

test2.php contains…

            echo "<p>hello</p>";
            include "Talent_Graphcopy.php"; // containing the graph code
            echo "<p>goodbye</p>";
  • 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-11T10:45:45+00:00Added an answer on June 11, 2026 at 10:45 am

    $graph->StrokeCSIM() produces a graph in the form of an image map. The PHP that contains this code (lets call it the graph script) is capable of generating both the supporting HTML and the graph image itself.

    When the graph script is called without parameters (e.g. http://contoso.com/graph.php), HTML is generated. The HTML generated contains an IMG tag that points to the script itself with a magic parameter (e.g. <img src="graph.php?_jpg_csimd=1" ). When the script is called with the magic parameter, an image is generated.

    You cannot put in PHP code that produces HTML output into the graph script as it will prevent the image generation functionality from working correctly. If you want to mix your custom HTML with the graph output, you can include the graph script in another PHP script.

    e.g. Display.php

    echo "<p>hello</p>";
    include "Talent_Graphcopy.php"; // containing the graph code
    echo "<p>goodbye</p>";
    

    Talent_Graphcopy.php

    // fancy graph code...
    $graph->StrokeCSIM("Talent_Graphcopy.php"); 
    

    Specify the name of the graph script as an argument for StrokeCSIM. It tells the script to set the IMG SRC to point to the graph script itself for generating the graph. If you do not specify it, the IMG SRC will point to Display.php… which is wrong, because the browser will ask Display.php for the image, which it is obviously not capable of providing.

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

Sidebar

Related Questions

I am trying retrieve user name from the code through graph api, the below
I am trying to retrieve information through Facebook graph api, using the below code
I'm having data as like below. I need to plot graph based on region.
I'm currently trying to use the core-plot library to graph some data I get
below is the link to code regarding to dynamic graph. I am having a
The below code works, but for some reason the $('#chart').fadeTo callback seems to create
I'm trying to complete an example from php.net (code below) which allows you to
Dear fellow homo sapiens, I've created this graph using the code below (except without
When I run the below mentioned code using NetBeans, the allocated heap size graph
For some reason, the arrow on the tooltip for each graph point appears below

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.