|
|
| Author |
Message |
MU-IT Cacti User
Joined: 06 Nov 2007 Posts: 55
|
Posted: Wed Sep 03, 2008 10:40 am Post subject: [SOLVED] Sparklines.pl issue |
|
|
In trying to add a sparkline to my map, per http://wotsit.thingy.com/haj/cacti/rrd-stripgraph.html ...
I believe i've added the imager perl module correctly, I've compiled an executable (I'm using win2k3 server) to run and generate the sparkline using rrdtool, but the perl program fails on me, on line 100:
| Code: | | $font = Imager::Font->new(file => $tfont, size => $fontsize) || die($!); |
I get
| Quote: | | no such file or directory at sparkline.pl line 100 |
I've done a bit of very primitive perl coding (normally just for the regular expressions), so I'm struggling with what this line of code is trying to do. I'd be happy feeding $font a static value just to get this going.... but I don't understand what's going on here.
Thanks for all your help, and a great product!
Last edited by MU-IT on Thu Sep 04, 2008 2:44 pm; edited 1 time in total |
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2167 Location: United Kingdom
|
Posted: Wed Sep 03, 2008 11:10 am Post subject: |
|
|
It can't find your font file.
I think Imager deals with fonts differently onWindows to unix (I use this script on FreeBSD). From memory, you need to change the $ftont right up at the top to just be the font name (e.g. "Arial") and Imager uses the Windows GDI font loader instead of freetype to load fonts. Here's the docs for that. I never got a version of Imager for Windows with sensible format support (PNG, JPEG), so I haven't tried this myself. |
|
| Back to top |
|
 |
MU-IT Cacti User
Joined: 06 Nov 2007 Posts: 55
|
Posted: Wed Sep 03, 2008 12:31 pm Post subject: |
|
|
Thanks Howie, that did it.
changed code to:
| Code: | | $font = Imager::Font->new(face=>"$tfont", size => $fontsize); |
and I can spit out a nice little sparkline. pretty sweet.
Thanks again. |
|
| Back to top |
|
 |
|