我設置x_label_skip
跳過標籤,但它仍然試圖顯示最後一個標籤,它覆蓋另一個標籤,看起來很混亂。它不應該寫最後的標籤。它應該跳過最後一個標籤。我設置標籤的數量作爲有多少數據點的函數跳過。如何讓GD :: Graph不寫下最後的X標籤並覆蓋其他標籤?
這是什麼樣子:
代碼:
my $graph = GD::Graph::lines->new(400, 500);
$graph->set(
r_margin => 2,
x_label => 'Date',
y_label => 'Price',
title => "$symbol1, $symbol2",
dclrs => [ qw(lred lblue lgreen lyellow lpurple cyan lorange) ],
transparent => 0,
x_labels_vertical => 1,
x_label_skip => int ((@tmpDate * 8)/(400-50) + 1), # a function of # of data points, each label 8px. More labels, more skip.
) or die $graph->error;