jpgraph 设置X轴点
<?phprequire_once('jpg/jpgraph.php');require_once('jpg/jpgraph_line.php');require_onc...
<?php
require_once ('jpg/jpgraph.php');
require_once ('jpg/jpgraph_line.php');
require_once ('jpg/jpgraph_date.php');
$datay = array( 10,80,20,80,11,5,22,20.20,44.255 );
DEFINE('NDATAPOINTS',3600);
DEFINE('SAMPLERATE',2);
$start = time();
$end = $start+NDATAPOINTS*SAMPLERATE;
$graph = new Graph(1200,600);
$graph->SetMargin(40,40,30,130);
$graph->SetScale('datlin',0,200);
$graph->xaxis->SetLabelAngle(0);
$line = new LinePlot( $datay );
$line->SetFillColor('lightred@0.5');
$line->mark->SetType( MARK_FILLEDCIRCLE );
$line->mark->SetFillColor( 'red' );
$line->mark->SetWidth( 4 );
$line->SetColor( 'red' );
$line->SetCenter();
$graph->Add($line);
$graph->Stroke();
?>
以上是代码。。。。。。。。。。。。。。。。。。。
问题来了 : 怎么设置X轴每隔10分钟显示一个轴点,谢谢! 展开
require_once ('jpg/jpgraph.php');
require_once ('jpg/jpgraph_line.php');
require_once ('jpg/jpgraph_date.php');
$datay = array( 10,80,20,80,11,5,22,20.20,44.255 );
DEFINE('NDATAPOINTS',3600);
DEFINE('SAMPLERATE',2);
$start = time();
$end = $start+NDATAPOINTS*SAMPLERATE;
$graph = new Graph(1200,600);
$graph->SetMargin(40,40,30,130);
$graph->SetScale('datlin',0,200);
$graph->xaxis->SetLabelAngle(0);
$line = new LinePlot( $datay );
$line->SetFillColor('lightred@0.5');
$line->mark->SetType( MARK_FILLEDCIRCLE );
$line->mark->SetFillColor( 'red' );
$line->mark->SetWidth( 4 );
$line->SetColor( 'red' );
$line->SetCenter();
$graph->Add($line);
$graph->Stroke();
?>
以上是代码。。。。。。。。。。。。。。。。。。。
问题来了 : 怎么设置X轴每隔10分钟显示一个轴点,谢谢! 展开
1个回答
展开全部
由于写一些小东西需要生成柱状图,决定jpgraph来生成图像,可结果不是很理想,因为标题是中文,出现了乱码,顺手问了度娘一下,结果没看到我想要的答案,最后求助于谷歌,解决了大半问题…解决如下:
1)修改jpgraph_ttf.inc.php,找到185行:elseif( $aFF === FF_SIMSUN ) {这里,代码如下:
elseif( $aFF === FF_SIMSUN ) {
// Do Chinese conversion
if( $this->g2312 == null ) {
include_once 'jpgraph_gb2312.php' ;
$this->g2312 = new GB2312toUTF8();
}
return $this->g2312->gb2utf8($aTxt);
1)修改jpgraph_ttf.inc.php,找到185行:elseif( $aFF === FF_SIMSUN ) {这里,代码如下:
elseif( $aFF === FF_SIMSUN ) {
// Do Chinese conversion
if( $this->g2312 == null ) {
include_once 'jpgraph_gb2312.php' ;
$this->g2312 = new GB2312toUTF8();
}
return $this->g2312->gb2utf8($aTxt);
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询