Skip Menu |

This queue is for tickets about the Chart-Graph CPAN distribution.

Report information
The Basics
Id: 81688
Status: rejected
Priority: 0/
Queue: Chart-Graph

People
Owner: Nobody in particular
Requestors: porton [...] narod.ru
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Should set font and encoding preliminarily
The following works well: gnuplot({'title' => 'Google positions', 'xdata' => 'time', 'timefmt' => '%Y-%m-%d', 'x-axis label' => 'Date', 'y-axis label' => 'Position', 'output file' => undef, 'output type' => 'png', 'yrange' => "[$min:$max] reverse", 'extra_opts' => join "\n", ('set encoding utf8', 'set format x "%d-%b-%Y"', 'set ytics 1', 'set xtics 86400', 'set term png font "Arial,12"', 'set key font "/usr/local/lib/X11/fonts/webfonts/arial.ttf"', 'unset mxtics'), }, @graphs); But when I replace 'x-axis label' and 'y-axis label' with strings in Russian language it shows a nonsense in the labels. I am unsure but suppose that extra_opts setting Russian encoding runs after setting the labels and thus has no effect.
On Tue Dec 04 05:05:26 2012, PORTON wrote: Show quoted text
> The following works well: > > gnuplot({'title' => 'Google positions', > 'xdata' => 'time', > 'timefmt' => '%Y-%m-%d', > 'x-axis label' => 'Date', > 'y-axis label' => 'Position', > 'output file' => undef, > 'output type' => 'png', > 'yrange' => "[$min:$max] reverse", > 'extra_opts' => join "\n", ('set encoding utf8', 'set format x > "%d-%b-%Y"', 'set ytics 1', 'set xtics 86400', 'set term png font > "Arial,12"', 'set key font > "/usr/local/lib/X11/fonts/webfonts/arial.ttf"', 'unset mxtics'), > }, > @graphs); > > But when I replace 'x-axis label' and 'y-axis label' with strings in > Russian language it shows a nonsense in the labels. I am unsure but > suppose that extra_opts setting Russian encoding runs after setting the > labels and thus has no effect.
The boss commanded me to fix this bug. So I am going to dig into Chart::Graph::Gnuplot code and do it.
No, it is not a Chart::Graph::Gnuplot bug. The following works well: gnuplot({'encoding' => 'utf8', 'title' => 'Позиции Google', 'xdata' => 'time', 'timefmt' => '%Y-%m-%d', 'x-axis label' => 'Дата', 'y-axis label' => 'Позиция', 'output file' => undef, 'output type' => 'png', 'yrange' => "[$min:$max] reverse", 'extra_opts' => join "\n", ('set fontpath "/usr/local/lib/X11/fonts/webfonts"', 'set format x "%d-%b-%Y"', 'set xtics font "/usr/local/lib/X11/fonts/webfonts/arial.ttf"', 'set ytics font "/usr/local/lib/X11/fonts/webfonts/arial.ttf"', 'set ytics 1', 'set xtics 86400', #'set term png font "Arial,12"', 'set term png font "/usr/local/lib/X11/fonts/webfonts/arial.ttf"', 'set key font "/usr/local/lib/X11/fonts/webfonts/arial.ttf"', 'set title font "/usr/local/lib/X11/fonts/webfonts/arial.ttf"', 'unset mxtics'), }, @graphs);