doulai5585 2013-08-07 22:01
浏览 144
已采纳

使用SetScale时,JpGraph LinePlot输出超出图形区域

I'm using JpGraph to graph some data. When I use the SetScale function to force a y-axis range the output visually overflows the graph area. I would like to have the output cropped to the graph area.

<?php

require_once ('include/jpgraph/jpgraph.php');
require_once ('include/jpgraph/jpgraph_line.php');

$datay1 = array(20,7,16,46,90,5,0,5,95);

// Setup the graph
$graph = new Graph(400,300);
$graph->title->Set('Graph Title');
$graph->title->font_size = 20;
$graph->SetScale("textlin",20,50);

//this version works but does not set the y-axis scale
//$graph->SetScale("textlin");

$p1 = new LinePlot($datay1);
$graph->Add($p1);

// Output line
$graph->Stroke();

?>

This is the current output:
enter image description here

This is the desired output (rendered by Excel):
enter image description here

  • 写回答

2条回答 默认 最新

  • dongshuo5101 2013-10-21 15:15
    关注

    I got in touch with the company behind JpGraph and they were able to help. The missing option is:

    $graph->setClipping(true);
    

    I hope this helps anyone else who may have a similar issue.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测