簡體   English   中英

在JPGraph中設置繪圖區域背景顏色

[英]Setting plot area background color in JPGraph

似乎$graph->SetColor('red'); 並沒有真正做任何事情(來自JPGraph的example0.html:

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

// Some data
$ydata = array(11,3,8,12,5,1,9,13,5,7);

// Create the graph. These two calls are always required
$graph = new Graph(350,250);
$graph->SetScale('textlin');
$graph->SetColor('red'); #        <---- this does nothing 
// Create the linear plot
$lineplot=new LinePlot($ydata);
$lineplot->SetColor('blue');

// Add the plot to the graph
$graph->Add($lineplot);

// Display the graph

$graph->Stroke();
?>

我想念什么?

我發現我需要停用軸網格的顯示,它似乎優先於背景顏色設置。 添加$graph->ygrid->Show(false, false); 顏色設置起作用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM