开发者

Why can't I change the font size or type in GD::Graph?

开发者 https://www.devze.com 2023-01-22 09:55 出处:网络
I\'m using the GD::bars module in Perl v 5.8, but I can\'t seem to get the font size on my graphs x and y labels and values to change. Here\'s the relevant code I am using:

I'm using the GD::bars module in Perl v 5.8, but I can't seem to get the font size on my graphs x and y labels and values to change. Here's the relevant code I am using:

use GD::Graph::bars3d;
use GD::Text;

$my_graph->set_title_font(gdMediumBoldFont, 15); 
$my_graph->se开发者_如何学编程t_x_label_font(gdMediumBoldFont, 15); 
$my_graph->set_y_label_font(gdMediumBoldFont, 15); 
$my_graph->set_x_axis_font(gdMediumBoldFont, 15); 
$my_graph->set_y_axis_font(gdMediumBoldFont, 15); 
$my_graph->set_legend_font(gdMediumBoldFont, 15); 

my $plot = $my_graph->plot(\@table_data); 

I also tried using

$my_graph->set_title_font('arial', 15); 
$my_graph->set_x_label_font('arial, 15); 
$my_graph->set_y_label_font('arial, 15); 
$my_graph->set_x_axis_font('arial, 15); 
$my_graph->set_y_axis_font('arial, 15); 
$my_graph->set_legend_font('arial, 15); 

and setting the font size to a huge number like 60 or something. But there isn't any change at all. I've tried different fonts as well, even trying /Arial.ttf but no luck.

Also, I'm saving my graph as a .gif file .

0

精彩评论

暂无评论...
验证码 换一张
取 消