急提示JpGraph Error A plot has an illegal scale. 。解决思路

WBOY
풀어 주다: 2016-06-13 13:44:43
원래의
1036명이 탐색했습니다.

急急急,提示JpGraph Error A plot has an illegal scale. 。。。。
我把x y轴的数据用数据库的数据,但报错,提示JpGraph Error A plot has an illegal scale. This could for example be that you are trying to use text auto scaling to draw a line plot with only one point or that the plot area is too small. It could also be that no input data value is numeric (perhaps only '-' or 'x'),我的代码如下。就是标注的地方修改,其他地方原封不动抄的例子


$data = $cny; //Y轴红线数据数组, $cny 是数据:1,25
$lbl = $cnx; //x轴数据 $cny 是日期 09-01,09-28

//////////////////////下面跟例子一样///

$graph = new Graph(1028 ,500); //创建新的Graph对象,图片长:400px,宽300px

$graph->SetScale("textlin"); //设置刻度模式

$graph->img->SetMargin(30 , 30 , 80 , 30) ; //设置图表边界

$graph->title->Set("**银行订单走势图") ; //设置图表标题

$graph->title->SetFont(FF_SIMSUN,FS_BOLD); // 设置标题中文字体
$graph->legend->SetFont(FF_SIMSUN,FS_BOLD); //设置线条指示字体

$lineplot = new LinePlot($data); //创建新的LinePlot对象

$lineplot->SetLegend("红线");//设置图例文字


$lineplot->SetColor("red"); //设置曲线颜色

$graph->xaxis->SetTickLabels($lbl); //配置x轴坐标


$graph->Add($lineplot); //在统计图上绘制曲线


------解决方案--------------------
不是很清楚你的问题。
$data = $cny; 
$lbl = $cnx; 

是这两个值引起的问题?那你和原来使用的值比较一下呗,看看类型什么的,是否有不同。
------解决方案--------------------
有点怪,哈哈
哪有不支持变量的?
$cny = array(2,4,7);
你是说这个样子不行?

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!