{
    "content": [
        {
            "type": "text",
            "text": "# GD::Graph::FAQ (perldoc)\n\n## NAME\n\nGD::Graph::FAQ - Frequently asked questions\n\n## DESCRIPTION\n\nI get errors like \"Can't call method METHOD on an undefined value\". What gives?\nYou probably had an error somewhere, most likely in the plot() method, and you didn't check for\nit. See the section on Error Handling in the documentation for GD::Graph to find out how to deal\nwith this sort of thing, and how to get more information about what the error was.\n\n## Sections\n\n- **NAME**\n- **IMPORTANT**\n- **DESCRIPTION** (2 subsections)\n- **AUTHOR**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "GD::Graph::FAQ",
        "section": "",
        "mode": "perldoc",
        "summary": "GD::Graph::FAQ - Frequently asked questions",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "IMPORTANT",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 51,
                "subsections": [
                    {
                        "name": "TrueType fonts don't work when I use GD::Graph from a CGI program.",
                        "lines": 29
                    },
                    {
                        "name": "When I have many data sets, some end up having the same colour.",
                        "lines": 23
                    }
                ]
            },
            {
                "name": "AUTHOR",
                "lines": 9,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "GD::Graph::FAQ - Frequently asked questions\n",
                "subsections": []
            },
            "IMPORTANT": {
                "content": "Take a look at \"DISTRIBUTION STATUS\" in GD::Graph first.\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "I get errors like \"Can't call method METHOD on an undefined value\". What gives?\nYou probably had an error somewhere, most likely in the plot() method, and you didn't check for\nit. See the section on Error Handling in the documentation for GD::Graph to find out how to deal\nwith this sort of thing, and how to get more information about what the error was.\n\nI am drawing a bar chart, and the chart area is a lot smaller than the image. What is going on?\nAs of version 1.30, GD::Graph automatically corrects the width of the plotting area of a chart\nif it needs to draw bars (i.e. for bars and some mixed charts). This is necessary, because\nrounding errors cause irregular gaps between or overlaps of bars if the bar is not an exact\ninteger number of pixels wide.\n\nIf you want the old behaviour back, set the correctwidth attribute to a false value.\n\nI have my data in some format that doesn't look at all like the array that I am supposed to give to GD::Graph's plot method. Do I really need to mess around with array references?\nNot necessarily. Check out the GD::Graph::Data class.\n\nHow do I stop those pesky accents appearing around bars or inside area charts?\nYou can set the \"accenttreshold\" option to a large enough value (larger than your chart).\nAlternatively, you may like it better to set the \"borderclrs\" attribute to be the same as the\ndclrs one.\n\nI'll probably include an option in a future version that gives better control over this.\n\nWhere is the ActiveState ppm of GD::Graph?\nAsk them. I have asked them, but didn't get an answer. I don't know what to do to get it\nincluded in their set of ppms, and I really do not have the time to keep asking them.\n\nI believe that GD::graph has finally made it into ActiveState's ppm archive. However, I am going\nto leave this question here in case they get behind again.\n\nDo you have some example code for me?\nThe distribution has a large set of examples in it. If you don't have the original distribution,\nplease get it from CPAN (http://www.cpan.org/ or some local mirror).\n\nWill you support X or Y?\nIf you send me a patch that (in a decent manner) adds the functionality to the latest version, I\nmay very well add it for the next release. If you don't send me a patch, but just a question,\nyou will have to be patient. (Please also see the section on bugs in the main body of\nGD::Graph.)\n\nWhy does exportformat give me a weird string, instead of just 'png' or 'gif'?\nAs of version 1.31, exportformat in a list context returns all formats that GD can export. If\nyou are only interested in the answer 'gif' or 'png', make sure that you call it in a scalar\ncontext.\n\n$exportformat = GD::Graph->exportformat;\n$exportformat = $graph->exportformat;\nprint \"Export format is \", scalar $graph->exportformat, \"\\n\";\nprint \"Export format is \" .  $graph->exportformat . \"\\n\";\n@exportformats = $graph->exportformat;\n",
                "subsections": [
                    {
                        "name": "TrueType fonts don't work when I use GD::Graph from a CGI program.",
                        "content": "When your programs run as CGI, they typically do not have the same environment as when you use\nthem from the command line. The Perl FAQ, section 9, has some information on this. It is also\nnot guaranteed that your script runs from the directory that it is in. It is probably better to\ninclude something like:\n\nuse GD::Text;\nGD::Text->fontpath(\"/path/to/my/fontdir\");\n\nSee the GD::Text documentation for more information about font paths.\n\nI'm trying to use GD's builtin fonts, but it's not working.\nMost likely, you are using the font short name, like gdGiantFont or gdMediumBoldFont, and you\nhave not put a \"use GD\" in your program. This is needed, because these short names need to be\nexported into your name space by the GD library:\n\nuse GD;\n# ...\n$graph->setxaxisfont(gdMediumBoldFont);\n\nIf you don't want to include the GD library, you can use the longer alternative names (which is\nwhat I'd recommend anyway):\n\n$graph1->setxaxisfont(GD::Font->MediumBold);\n\nIf you \"use strict\" then you will actually get an error message if you try to use the short\nnames without including the GD module.\n\nAlso see the GD::Text documentation for this information.\n"
                    },
                    {
                        "name": "When I have many data sets, some end up having the same colour.",
                        "content": "The default number of colours for data sets is seven, so if you use more than seven data sets,\nthose colours will be re-used for the higher data sets.\n\nThis is described in the entry for the \"dclrs\" attribute in the GD::Graph documentation.\n\nCan you tell me how to do X?\nNot necessarily (X might be kind of complicated, after all). Did you look in the samples for\nsomething similar? If not, you're probably best off seeing if you can get help from a group of\npeople, rather than one or the other of the overworked individuals whose e-mail addresses are\nshown below.\n\nIf you're more comfortable with asking a newsgroup for help, the canonical resource is\n<comp.lang.perl.misc>; if you prefer web forums, there is a good one at\n<http://www.perlmonks.org>.\n\nIn either case, if you are not familiar with the forum and its denizens, you might wish to read\nthe following helpful guide before posting your question:\nhttp://www.perlmonks.org/?nodeid=172086\n\nCan you fix this bug I've found?\nWell, I hope so. Please see the \"BUGS\" section in the main body of GD::Graph for the best way to\nreport it.\n"
                    }
                ]
            },
            "AUTHOR": {
                "content": "Martien Verbruggen <mgjv@tradingpost.com.au>\n\nCurrent maintenance (including this release) by Benjamin Warfield <bwarfield@cpan.org>\n\n(c) Martien Verbruggen.\n\nAll rights reserved. This package is free software; you can redistribute it and/or modify it\nunder the same terms as Perl itself.\n",
                "subsections": []
            }
        }
    }
}