Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Axis values aren't being rendered #6

Closed
Htbaa opened this Issue · 6 comments

3 participants

@Htbaa

Hi,

I'm using Strawberry Perl 5.12.1 with Chart::Clicker 2.81 and Cairo 1.090 and I've tried running a couple of the example charts, as well as writing my own, but the values for the x and y axis aren't being rendered. I tried both line and bar graphs. For example, line-shapes.pl renders fine but no values are present on the axis. I've tried both png and pdf output.

Is this a bug in Chart::Clicker?

@gphat
Owner

I've had frequent reports of problems with older versions of CentOS but I don't recall any with Strawberry. I suspect it's something font related in Cairo, not in Clicker.

@Htbaa

Thanks for the swift reply. Any pointers on how to change the font? I could check it right away.

@gphat
Owner

my $defctx = $cc->get_context('default');
$defctx->range_axis->label_font->family('Hoefler Text');

I don't think it's the font, mind you. I think it's the font backend.

Have you tried using Cairo.pm directly and drawing some text.

@Htbaa

Tried to change the font, not difference.
I've run http://api.metacpan.org/source/XAOC/Cairo-1.090/examples/png/text.pl and that one does properly draw text.
http://api.metacpan.org/source/XAOC/Cairo-1.090/examples/freetype-font.pl however doesn't because Font::FreeType isn't installed (and doesn't compile either, it also doesn't have any good results at CPAN Testers). Though I doubt Font::FreeType is required?

@Htbaa

Also tried it under a freshly installed Strawberry Perl 5.14.2 (32-bit) but it had the same effect. Sadly I no longer use Linux on my laptops or desktops, so I can't test those platforms.

Edit: Installed a Ubuntu 11.10 VM and this generates the graphs properly.

@gphat gphat closed this
@mguz

Hi,

I use Chart::Clicker V2.86 with ActiveState Perl V5.14.2 on Windows 7 32 bit (win32).
First I had the same results reported above.
After inserting a line in Graphics::Primitive::Driver::Cairo.pm the output was almost similar to the example-files:

foreach my $line (@{ $comp->layout->lines }) {
    my $text = $line->{text};
    my $tbox = $line->{box};

     next if not(defined($text)) || ($text eq '');   # <- This is the new added line

The only restriction is, that I can use just one font type, regardless the font type I choose.
Font size could be adjusted.
I think that the source of the problem is somewhere in a module in
Graphics::Primitive
or
Graphics::Primitive::Driver::Cairo::TextLayout
which has a different behaviour under Windows than under Linux.
It seems not to be a Cairo driver problem.

This is the example plot file from this server:

line_example_from_server

This is my generated output after inserting the line described above:

line_with_first_modification

The second modification is just to set the ticks number from 5 to 6

line_with_second_modification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.