为什么我无法更改 GD::Graph 中的字体大小或类型?
我正在 Perl v 5.8 中使用 GD::bars 模块,但我似乎无法更改图表 x 和 y 标签上的字体大小以及要更改的值。这是我正在使用的相关代码:
use GD::Graph::bars3d;
use GD::Text;
$my_graph->set_title_font(gdMediumBoldFont, 15);
$my_graph->set_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);
我还尝试使用
$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);
并将字体大小设置为一个巨大的数字,例如 60 等。但根本没有任何变化。我也尝试过不同的字体,甚至尝试过 /Arial.ttf
但没有成功。
另外,我将图表保存为 .gif 文件。
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->set_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 .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论