| 1 | package SVGraph; | ||
| 2 | |||
| 3 | use warnings; | ||
| 4 | use strict; | ||
| 5 | |||
| 6 | =head1 NAME | ||
| 7 | |||
| 8 | SVGraph - Library that generates cool SVG graphs | ||
| 9 | |||
| 10 | =cut | ||
| 11 | |||
| 12 | our $VERSION = '0.02'; | ||
| 13 | |||
| 14 | use SVGraph::Core; | ||
| 15 | |||
| 16 | =head1 SYNOPSIS | ||
| 17 | |||
| 18 | use SVGraph::2D::lines; | ||
| 19 | |||
| 20 | my $graph=SVGraph::2D::lines->new( | ||
| 21 | title => "My graph", | ||
| 22 | type => "normal/percentage", | ||
| 23 | x => 500, | ||
| 24 | y => 300, | ||
| 25 | show_lines => 1, | ||
| 26 | show_points => 1, | ||
| 27 | grid_y_main_lines => 0, | ||
| 28 | show_label_textsize => 20, | ||
| 29 | show_legend => 1, | ||
| 30 | show_data => 1, | ||
| 31 | show_data_background => 1, | ||
| 32 | show_grid_x => 0 | ||
| 33 | ); | ||
| 34 | |||
| 35 | # two columns -> two lines in the graph | ||
| 36 | my %columns; | ||
| 37 | $columns{first}=$graph->addColumn(title=>"first", show_line=>1); | ||
| 38 | $columns{second}=$graph->addColumn(title=>"second", show_line=>1); | ||
| 39 | |||
| 40 | $graph->addRowLabel('1'); | ||
| 41 | $graph->addRowLabel('2'); | ||
| 42 | $graph->addRowLabel('3'); | ||
| 43 | |||
| 44 | $graph->addValueMark(20,front => 1, color => 'blue', right => 1, | ||
| 45 | show_label_text => 'something', show_label => 1); | ||
| 46 | |||
| 47 | # data for graph | ||
| 48 | $columns{first}->addData('1',30); | ||
| 49 | $columns{first}->addData('2',60); | ||
| 50 | $columns{first}->addData('3',50); | ||
| 51 | $columns{second}->addData('1',20); | ||
| 52 | $columns{second}->addData('2',0); | ||
| 53 | $columns{second}->addData('3',70); | ||
| 54 | |||
| 55 | # creates svg file | ||
| 56 | print $graph->prepare; | ||
| 57 | |||
| 58 | =head1 AUTHOR | ||
| 59 | |||
| 60 | Roman Fordinal, C<< <comsultia at cpan.org> >> | ||
| 61 | |||
| 62 | =head1 BUGS | ||
| 63 | |||
| 64 | Please report any bugs or feature requests to C<bug-svgraph at rt.cpan.org>, or through | ||
| 65 | the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=SVGraph>. I will be notified, and then you'll | ||
| 66 | automatically be notified of progress on your bug as I make changes. | ||
| 67 | |||
| 68 | =head1 SUPPORT | ||
| 69 | |||
| 70 | You can find documentation for this module with the perldoc command. | ||
| 71 | |||
| 72 | perldoc SVGraph | ||
| 73 | |||
| 74 | |||
| 75 | You can also look for information at: | ||
| 76 | |||
| 77 | =over 4 | ||
| 78 | |||
| 79 | =item * RT: CPAN's request tracker | ||
| 80 | |||
| 81 | L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=SVGraph> | ||
| 82 | |||
| 83 | =item * AnnoCPAN: Annotated CPAN documentation | ||
| 84 | |||
| 85 | L<http://annocpan.org/dist/SVGraph> | ||
| 86 | |||
| 87 | =item * CPAN Ratings | ||
| 88 | |||
| 89 | L<http://cpanratings.perl.org/d/SVGraph> | ||
| 90 | |||
| 91 | =item * Search CPAN | ||
| 92 | |||
| 93 | L<http://search.cpan.org/dist/SVGraph> | ||
| 94 | |||
| 95 | =back | ||
| 96 | |||
| 97 | |||
| 98 | =head1 ACKNOWLEDGEMENTS | ||
| 99 | |||
| 100 | |||
| 101 | =head1 COPYRIGHT & LICENSE | ||
| 102 | |||
| 103 | Copyright 2009 Roman Fordinal, all rights reserved. | ||
| 104 | |||
| 105 | This program is free software; you can redistribute it and/or modify it | ||
| 106 | under LGPLv2. | ||
| 107 | |||
| 108 | =cut | ||
| 109 | |||
| 110 | 1; |