Jpgraph wont change colors on my barplot

﹥>﹥吖頭↗ 提交于 2019-11-30 09:27:46

I had the same problem, the solution I found is to define the formatting after the BarPlot class initialization

$bplot = new BarPlot($datay);
$graph->Add($bplot);
$bplot->value->Show();
$bplot->value->SetFont(FF_ARIAL,FS_BOLD,12);
$bplot->value->SetAlign('left','center');
$bplot->value->SetColor('black','darkred');
$bplot->value->SetFormat('%.1f mkr');

Solution found here

I have the same problem, and this is my solution: just add "ClearTheme()",like this:

     $graph = new Graph(310,200); 
     $graph->ClearTheme();    
codemonkee

This is due to the Add() using the Theme default settings. There are two solutions

  1. Add plot before applying settings
  2. Remove Theme $graph->graph_theme = null; after $graph->SetScale() or adjust the theme

Source: /docs/chunkhtml/ch29.html - Part VII. Theme Class

I recently dug into this as my legend was also not displaying correctly JpGraph: How to control x/y offset, margins and color in v3.5.0b1 when using AccBarPlot?

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!