jpgraph

jpGraph can't include PHP file

邮差的信 提交于 2019-12-12 01:09:52
问题 I am trying to include one PHP file in another PHP file that creates a jpGraph image (The reason is that I am loading mySQL data for the chart, and I want to put the login credentials into a separate file) I know that the chart is created (because a correct image file is created) but the chart does not show up in the web page. Here is a simplified code example: login.inc.php <?php $lhostname="localhost"; $lusername="joeschmack"; $lpassword="autumnleaf"; $ldatabase="customers"; ?> accbarex1

Is the JPGraph library dead?

这一生的挚爱 提交于 2019-12-11 12:36:06
问题 I cannot find any link to the official jpgraph forum. Moreover, the last "real" release was made more than one year ago. Is this library dead? If so, what library could be used in its place with minimal disruption to existing code? Perhaps there has been a fork that I'm not finding? 回答1: Since they've been purchased by asial the development stopped. There is no fork as it's a pure commercial product now. However there are other really professional PHP solutions around. If you don't need PHP,

change margin color for a jpgraph

余生颓废 提交于 2019-12-11 04:57:25
问题 I am trying to change the color of the margin on a jpgraph. I cannot seem to figure it out. I tried $graph->SetMarginColor("khaki:0.6"); but that seemed to do nothing. below is the code that generates an example chart as well as the sample output. I am using jpgraph 3.5 if that helps. $datay1 = array(20,15,23,15); $datay2 = array(12,9,42,8); $datay3 = array(5,17,32,24); // Setup the graph $graph = new Graph(300,250); $graph->SetScale("textlin"); $theme_class=new UniversalTheme; $graph-

Jpgraph : how set label for group bar column chart in php

青春壹個敷衍的年華 提交于 2019-12-11 02:33:32
问题 here is my jpgraph demo code: <?php // content="text/plain; charset=utf-8" // $Id: groupbarex1.php,v 1.2 2002/07/11 23:27:28 aditus Exp $ require_once ('jpgraph/jpgraph.php'); require_once ('jpgraph/jpgraph_bar.php'); $datay1=array(35,160,0,0,0,0); $datay2=array(35,190,190,190,190,190); $datay3=array(20,70,70,140,230,260); $graph = new Graph(450,200,'auto'); $graph->SetScale("textlin"); $graph->SetShadow(); $graph->img->SetMargin(40,30,40,40); $graph->xaxis->SetTickLabels($gDateLocale-

JpGraph: How to control x/y offset, margins and color in v3.5.0b1 when using AccBarPlot?

那年仲夏 提交于 2019-12-06 11:32:22
A little background I am attempting to migrate a project built with Symfony 1.2 from one server to another. One of the functions of the project is to build a graph (originally done with JpGraph 2.3.5). The graph does not display as intended without modifications to the code and am looking for some insight on what I might be overlooking. Images are linked due to not having enough points to post. Graph Image Gallery The following graph is what is generated by the code block below <?php public function Graph($section) { $report = $section->getReport(); $this->crews = array(); foreach ($section-

How to embed a graph (jpgraph) in a web-page

烈酒焚心 提交于 2019-12-04 21:19:51
问题 I am using this script which is one of the examples provided by jpgraph itself. When I put this on a web-page (blank) by itself, it's drawing the graph. But when I embed the code in already existing web-page (with some content), it ain't drawing a graph. GD is already enabled according to phpinfo(). Iam using jpgraph 3.5.0b1. 回答1: The problem is that you are mixing HTML/text output with image output. Any time you have a PHP script generate graphical content you have to handle the output

Jpgraph wont change colors on my barplot

£可爱£侵袭症+ 提交于 2019-12-03 19:38:45
问题 I'm just getting started with jpgraph and XAMPP I was looking to make a barplot. As I was reading some articles on the web it said you could pass in an array of colors to setfillcolor so that each bar would be a different color. However whenever I pass it color the graph won't change from its default color of light blue. The graph respond s to changes in data but not changes to color. I tried with an accumulated bar graph example and that seems to be color responsive. I'm not sure how to

How to embed a graph (jpgraph) in a web-page

拈花ヽ惹草 提交于 2019-12-03 15:18:06
I am using this script which is one of the examples provided by jpgraph itself. When I put this on a web-page (blank) by itself, it's drawing the graph. But when I embed the code in already existing web-page (with some content), it ain't drawing a graph. GD is already enabled according to phpinfo(). Iam using jpgraph 3.5.0b1. The problem is that you are mixing HTML/text output with image output. Any time you have a PHP script generate graphical content you have to handle the output differently than normal HTML or text. There are a few routes, I'll cover them briefly here. Save the output to a

JpGraph Error: HTTP headers have already been sent

点点圈 提交于 2019-12-02 05:17:12
问题 The problem is that the JpGraph is not displayed correctly on my web-page. The strange thing is that if I run the above code in isolation, then it works. But if I insert it in my main code, it fails producing the above-shown message. P.S. I'm using 'ob_start();', but it does not solve the problem. // A new graph with automatic size $graph = new GanttGraph (0,0, "auto"); // A new activity on row '0' $activity = new GanttBar (0,"Project", "2001-12-21", "2002-02-20"); $graph->Add( $activity); //

PHP数据展示之JpGraph类库

独自空忆成欢 提交于 2019-12-01 17:29:17
1. JpGraph 的介绍 1) jpgraph 是一种专门用于绘制统计图的运行库 , 使用 jpgraph 创建统计图时 , 只需要给出相应的数据 , 就能设置统计图标题和统计图类型即可 . 2) jpgraph 是一种面向对象的图像绘制库 , 既有 GD2 函数库 , 对其中函数进行封装 , 得到了几个用于生成统计图的函数 3) 可以生成 X-Y 坐标图 ,X-Y-Y 坐标图 , 柱形图 , 饼图 ,3D 饼图等统计图 , 并会自动生成坐标轴 , 坐标轴刻度 , 图例等信息 , 帮助我们快速生成所需样式 . 2. JpGraph 类库基本使用 2-1JpGraph 类库的安装和配置 下载地址 : https://jpgraph.net/download/ 只需要解压文件拷贝 src文件到项目文件夹即可使用 注意 :需要GD库支持 2-2JpGraph 类库的实例 2-2-1 创建 X-Y 坐标图 <?php //引入相关文件 require_once '../jpgraph/jpgraph-4.2.7/src/jpgraph.php' ; require_once '../jpgraph/jpgraph-4.2.7/src/jpgraph_line.php' ; //创建画布 $graph = new Graph ( 600 , 400 ) ; /* * 设置横纵坐标刻度样式