GD :: ±×·¡ÇÁ ¼øÀ§ ¹× ¿ä¾à
- ƯÇã:
- Perl Artistic License
- °Ô½ÃÀÚ À̸§:
- Martien Verbruggen
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://search.cpan.org/~bwarfield/GDGraph-1.44/Graph/Data.pm
GD :: ±×·¡ÇÁ ű×
GD :: ±×·¡ÇÁ ¼³¸í
Perl 5 ¿ë ±×·¡ÇÁ Ç÷ÎÆà ¸ðµâ GD :: GRAPH´Â PERL ¿ë ±×·¡ÇÁ Ç÷ÎÆà ¸ðµâÀÔ´Ï´Ù. GD :: GRAPH :: MODULENAME; GD :: GRAPH´Â GD ¸ðµâÀ» »ç¿ëÇÏ¿© Â÷Æ®¸¦ ÀÛ¼ºÇÏ´Â PERL5 ¸ðµâÀÔ´Ï´Ù. ÃàÀ» »ç¿ëÇÑ ±×·¡ÇÁÀÇ ´ÙÀ½ Ŭ·¡½º°¡ Á¤Àǵ˴ϴÙ. GD :: GRAPH :: LINESCREATE A LINE CHART.GD::GRAph:BARS ¹× GD :: ±×·¡ÇÁ :: HBARSCREATE ¼¼·Î ¶Ç´Â °¡·Î ¹Ù¸¦ °¡Áø ¸·´ë Â÷Æ® .GD ::GRAPH : : PointScreate µ¥ÀÌÅ͸¦ points.gd::Graph::L.GD¿Í PointsCombinationÀÇ µ¥ÀÌÅ͸¦ Ç¥½ÃÇÕ´Ï´Ù. Lines.gd:Graph:::Areareate Line.gd::Graph::MixedCreate ¾Æ·¡ ¿µ¿ªÀ¸·Î µ¥ÀÌÅ͸¦ ³ªÅ¸³»´Â ±×·¡ÇÁ È¥ÇÕ Çü ±×·¡ÇÁ, À§ÀÇ Á¶ÇÕ. ÇöÀç ÀÌ°ÍÀº »ó´çÈ÷ Á¦ÇÑÀûÀÔ´Ï´Ù. ÀϺΠ°³º° ±×·¡ÇÁ À¯Çü Áß ÀÏºÎ¿Í ÇÔ²² »ç¿ëÇÒ ¼öÀÖ´Â ¿É¼Ç Áß ÀϺδ Àß ÀÛµ¿ÇÏÁö ¾Ê½À´Ï´Ù. ¶óÀÎÀ̳ª Æ÷ÀÎÆ® ±×·¡ÇÁ ÀÌÈÄ¿¡ ±×·ÁÁø ¸·´ë ±×·¡ÇÁ´Â ÀÌÀü µ¥ÀÌÅ͸¦ ¸ðÈ£ÇÏ°Ô ÇÒ ¼ö ÀÖÀ¸¸ç bar_width°¡ ¾Æ¸¶µµ ¿¹»óµÇ´Â °á°ú¸¦ »ý¼ºÇÏÁö ¾ÊÀ» ¼ö ÀÖ½À´Ï´Ù. GD :: Graph :: PiecReate Pie Chart.usage : x¿Í ÇÔ²² ¹è¿À» ä¿ì½Ê½Ã¿À. °ª ¹× µ¥ÀÌÅÍ ¼¼Æ®ÀÇ °ª. ¸ðµç ¹è¿ÀÌ µ¿ÀÏÇÑ Å©±âÀÎÁö È®ÀÎÇϽʽÿÀ. ±×·¸Áö ¾ÊÀ¸¸é GD :: ±×·¡ÇÁ´Â ºÒ¸¸À»ÁÖ°í ±×·¡ÇÁ¸¦ ÄÄÆÄÀÏÇÕ´Ï´Ù. @data = (, , [Á¤·Ä {$ a $ b} (1, 2, 5, 6, 3, 1.5, 1, 3, 4)); °¡Ä¡°¡¾ø´Â °æ¿ì ƯÁ¤ µ¥ÀÌÅÍ ÁýÇÕÀÇ ÇÑ ÁöÁ¡ÀÇ °æ¿ì Undef¸¦ »ç¿ëÇÒ ¼ö ÀÖÀ¸¸ç Æ÷ÀÎÆ®°¡ °Ç³Ê ¶Ý´Ï´Ù. ÀÛ¼ºÇÏ·Á´Â ±×·¡ÇÁ À¯ÇüÀÇ »õ ¸Þ¼Òµå¸¦ È£ÃâÇÏ¿© »õ GD :: ±×·¡ÇÁ ¿ÀºêÁ§Æ®¸¦ »ý¼ºÇÕ´Ï´Ù (Â÷Æ®´Â ¸·´ë, HBAR, ¼±, Æ÷ÀÎÆ®, ¼± Æ÷ÀÎÆ®, È¥ÇÕ ¶Ç´Â ÆÄÀÌ). MY $ GRAPH = GD :: ±×·¡ÇÁ :: Â÷Æ® -> NEW (400, 300); ±×·¡ÇÁ ¿É¼ÇÀ» ¼³Á¤ÇÕ´Ï´Ù. $ graph-> set (x_label => x label ', y_label =>'y lable ', title =>'ÀϺΠ°£´ÜÇÑ ±×·¡ÇÁ ', y_max_value => 8, y_tick_number => 8, y_label_skip => 2) ¶Ç´Â die $ graph -> ¿À·ù; ±×·¡ÇÁ¸¦ Ç÷ÔÇϽʽÿÀ. MY $ GD = $ GRAPH-> PLOT (@DATA) ¶Ç´Â DIE $ GRAPH-> ¿À·ù; ±×·± ´ÙÀ½ ÇöÀç ¹öÀüÀÇ GD ¹öÀüÀ» »ç¿ëÇÏ¿© ÆÄÀÏÀ» ÀúÀåÇÒ ¼ö ÀÖ½À´Ï´Ù. GDÀÇ ¹öÀü 1.19 (¶Ç´Â ÃÖ±Ù 2.15 ¹Ì¸¸)ÀÇ °æ¿ì, Open (img, '> file.gif') ¶Ç´Â Die $!; binmode img; Àμâ IMG $ GD-> GIF; img ´Ý±â; ÃֽŠ¹öÀü (1.20 ÀÌ»ó)ÀÇ °æ¿ì ¿±â (img, '> file.png') ¶Ç´Â Die $!; binmode img; Àμâ IMG $ GD-> PNG; ¶Ç´Â ¿±â (img, '> file.gd2') ¶Ç´Â Die $!; binmode img; IMG $ GD-> GD2 Àμâ; ±×·± ´ÙÀ½ ¹°·Ð ´õ ªÀº ¹öÀüÀ» »ç¿ëÇÒ °¡´É¼ºÀÌ ÀÖ½À´Ï´Ù (GD Áö¿øÀÇ °¢ ³»º¸³»±â ÇÔ¼ö¿¡ ´ëÇØ) : IMG $ GRAPH-> ÇÃ·Ô (@DATA) -> GIF; Àμâ IMG $ GRAPH-> ÇÃ·Ô (@DATA) -> PNG; img $ graph-> ÇÃ·Ô (@Data) -> GD; Àμâ IMG $ GRAPH-> ÇÃ·Ô (@DATA) -> GD2; GIF ¶Ç´Â PNG¸¦ »ç¿ëÇÒÁö ¿©ºÎ¸¦ '¾Ë°í ÀÖÀ½'À» ÇÊ¿ä·ÎÇÏÁö ¾Ê´Â ¹«¾ð°¡¸¦ ÀÛ¼ºÇÏ·Á¸é ´ÙÀ½°ú °°Àº ÀÏÀ» ÇÒ ¼ö ÀÖ½À´Ï´Ù : if ($ gd- > can ( 'png')) {# blabla} ¶Ç´Â ÆíÀÇ ¹æ¹ý export_format : MY $ format = $ graph-> export_format; ¿±â (img, "> file. $ Format") ¶Ç´Â Die $!; binmode img; img $ graph-> plot (@data) -> $ format (); ´Ý±â img; ¶Ç´Â CGI ÇÁ·Î±×·¥ ¿ë : CGI QW (: Ç¥ÁØ)¸¦ »ç¿ëÇϽʽÿÀ. # ... ³» $ format = $ graph-> export_format; Àμâ Çì´õ ( "À̹ÌÁö / $ format"); binmode stdout; $ GRAPH-> PLOT (@DATA) -> $ format (); ($ Çü½Ä ÀÌÈÄ °ýÈ£°¡ ÇÊ¿äÇϸç ÄÄÆÄÀÏ·¯°¡ ¸Þ¼Òµå À̸§À» ÀǹÌÇÑ´Ù°í °áÁ¤ÇÏ´Â µ¥ µµ¿òÀÌ ÇÊ¿äÇÕ´Ï´Ù) ¿ä±¸ »çÇ× : ¡¤ Perl.
GD :: ±×·¡ÇÁ °ü·Ã ¼ÒÇÁÆ®¿þ¾î