in reply to Font size in GD::Graph module

From the GD pod:

Depending on your version of GD, this accepts both GD builtin fonts or + the name of a TrueType font file. In the case of a TrueType font, you must spec +ify the font size. See the GD::Text manpage for more details and other things, + since all font handling in GD::Graph is delegated to there. Examples: $my_graph->set_title_font('/fonts/arial.ttf', 18); $my_graph->set_legend_font(gdTinyFont); $my_graph->set_legend_font( ['verdana', 'arial', gdMediumBoldFont], 12) (The above discussion is based on GD::Text 0.65. Older versions have more restrictive behaviour).

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
"Memory, processor, disk in that order on the hardware side. Algorithm, algoritm, algorithm on the code side." - tachyon

Replies are listed 'Best First'.
Re^2: Font size in GD::Graph module
by Nalina (Monk) on Jul 08, 2004 at 12:14 UTC
    Thanks for the reply,

    I need one more clarification. I am using GD::Graph::pie module to generate pie chart. The legends appear on the chart it self. Is there any way to put the legends on the top or bottom of the chart, as we do it in line graphs?

    Also I want the chart to be at the bottom of the html page (I am using GD::Graph::Map module to export chart from png to html), as I have a table at the begining of the same page. How do I move the graph to the end? Thanks & Regards

    Nalina
      • Legends

        GD::Graph::pie doesn't support legends, so I assume that you mean that the labels are placed upon the pie. As far as I can see, there is no option or mechanism for adjusting these.

        However, the does seem to be a facility in GD::Graph::Map for producing an html legend but you'll have to read the docs and play.

      • GD::Graph::Map. I've never used this module so I can't help much, but from what I read, the imagemap() method returns the html to you. It's then just a case of you outputting it at the appropriate place in your html stream.

      Sorry I couldn't be more help.


      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "Think for yourself!" - Abigail
      "Memory, processor, disk in that order on the hardware side. Algorithm, algoritm, algorithm on the code side." - tachyon
        I couldn't put the chart in reqiured position with GD::Graph::Map. So I am not using it any more. Instead I followed these steps

        * close html file after drawing the table.

        * open the same file in append mode and expot chart from png file using code
        open (Rule, ">>$report") || die "can not open $report"; print Rule "<HTML><BODY BGCOLOR=white>\n"; print Rule "<INPUT TYPE=\"image\" style=\"position:absolute;left:200px +;\" SRC=$name.png BORDER=\"1\" title=\" Packet Drop Analysis \" >\n"; print Rule "</HEAD>\n"; print Rule "</BODY>\n"; print Rule "</HTML>\n";
        Also I increased the suppress_angle to 360 degrees, so that the labels will not appear on the chart.

        But I want the labels to be at the bottom or right side of the chart with pie chart slice colour indication, as we get it with chart wizard of MS excel. How can I achieve this?

        Thanks & Regards

        Nalina