jpGraph 中的透明背景
Transparent background in jpGraph
我正在尝试实现具有透明背景的折线图,但到目前为止,我只能将背景设置为特定颜色。由于它是 PNG,因此 应该 可以。
$linePlot = new LinePlot($plotData);
$linePlot->SetFillColor('#61a9f3@.6');
$graph = new Graph(300, 100);
$graph->SetScale('intint');
$graph->SetAlphaBlending();
$graph->SetMarginColor('black:1');
$graph->SetFrame(true,'black', 0);
$graph->Add($linePlot);
$graph->Stroke();
结果
不是透明的,而是黑色的
$graph->SetTheme($theme_class);
$graph->img->SetAntiAliasing(false);
$graph->title->Set('Filled Y-grid');
$graph->SetMarginColor('White:0.6');
$graph->SetFrame(true,'White:0.6',1); // The '1' here seems to be irrelevant
// I've tried much larger numbers with no
// change. This is supposed to be frame
// width (in pixels).
$graph->SetBox(false);
参考:change margin color for a jpgraph
透明 PNG 图片:$graph->img->SetTransparent("white"); 效果很好!!!
对我来说,我必须用黑色而不是白色来获得透明度!
$graph->SetMarginColor('black:0');
$graph->SetFrame(true,'black:0', 1); //but this make labels/letters weird !!!
$graph->img->SetTransparent('black');
现在,在一张图片中制作多个图形时,这不起作用。我尝试为每张图制作透明度或最后一张图(mgraph),我得到 'HTTP ERROR 500'(内部服务器!?!)
我正在尝试实现具有透明背景的折线图,但到目前为止,我只能将背景设置为特定颜色。由于它是 PNG,因此 应该 可以。
$linePlot = new LinePlot($plotData);
$linePlot->SetFillColor('#61a9f3@.6');
$graph = new Graph(300, 100);
$graph->SetScale('intint');
$graph->SetAlphaBlending();
$graph->SetMarginColor('black:1');
$graph->SetFrame(true,'black', 0);
$graph->Add($linePlot);
$graph->Stroke();
结果
不是透明的,而是黑色的
$graph->SetTheme($theme_class);
$graph->img->SetAntiAliasing(false);
$graph->title->Set('Filled Y-grid');
$graph->SetMarginColor('White:0.6');
$graph->SetFrame(true,'White:0.6',1); // The '1' here seems to be irrelevant
// I've tried much larger numbers with no
// change. This is supposed to be frame
// width (in pixels).
$graph->SetBox(false);
参考:change margin color for a jpgraph
透明 PNG 图片:$graph->img->SetTransparent("white"); 效果很好!!!
对我来说,我必须用黑色而不是白色来获得透明度!
$graph->SetMarginColor('black:0');
$graph->SetFrame(true,'black:0', 1); //but this make labels/letters weird !!!
$graph->img->SetTransparent('black');
现在,在一张图片中制作多个图形时,这不起作用。我尝试为每张图制作透明度或最后一张图(mgraph),我得到 'HTTP ERROR 500'(内部服务器!?!)