Board index   FAQ   Search  
Register  Login
Board index PHP PHP Scripts

Problem with bar chart (Need Help)

Links for php scripts

Moderators: macek, egami, gesf

Problem with bar chart (Need Help)

Postby IamNew » Thu Feb 16, 2012 2:51 am

Hi there,

I am currently doing a bar chart to display my data but there is some problem.

Here's the code I have:

Code: Select all




<?php // content="text/plain; charset=utf-8"
require_once ('jpgraph/jpgraph.php');
require_once ('jpgraph/jpgraph_bar.php');

$data1y=array($gpa11,$gpa21,$gpa31,$gpa41, $gpa51);
$data2y=array($gpa12,$gpa22,$gpa32,$gpa42, $gpa52);

// Create the graph. These two calls are always required
$graph = new Graph(350,200,'auto');

$theme_class=new UniversalTheme;

$graph->yaxis->SetTickPositions(array(0,30,60,90,120,150), array(15,45,75,105,135));

$graph->xaxis->SetTickLabels(array('Year 1','Year 2','Year 3','Year 4','Year 5'));

// Create the bar plots
$b1plot = new BarPlot($data1y);
$b2plot = new BarPlot($data2y);

// Create the grouped bar plot
$gbplot = new GroupBarPlot(array($b1plot,$b2plot));
// ...and add it to the graPH



$graph->title->Set("GPA Performance Graph");

// Display the graph

When I click to display the graph, it give a statement "JpGraph Error: 25067 Your manually specified scale and ticks is not correct. The scale seems to be too small to hold any of the specified tick marks." What should be done to correct this? Please advice :( .
New php-forum User
New php-forum User
Posts: 28
Joined: Fri Nov 04, 2011 6:29 am

Return to PHP Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.