New upstream version 2.403.7
gregor herrmann
1 year, 8 months ago
0 | 2.403.6 2022-08-21 lichtkind | |
1 | ------- | |
2 | * = POD rewrite release | |
3 | * ! gap in HTML tag in POD prevented lanfing page illustrations | |
4 | * ? final touche on new POD documentation | |
5 | ||
6 | 2.403.5 2022-08-18 lichtkind | |
0 | 2.403.7 2022-07-29 lichtkind | |
1 | ------- | |
2 | * = POD rewrite release | |
3 | * ? move landing page examples in own category, independent from test script runs | |
4 | * ? reduce references to gone modules in Chart.pm POD | |
5 | * ? clearify some bits in POD | |
6 | * ? several final touches on types manual page and example images | |
7 | * ! fix sub title in manual demo of pie chart | |
8 | * ! bad dates, typos in Changes | |
9 | ||
10 | 2.403.6 2022-07-21 lichtkind | |
11 | ------- | |
12 | * = POD rewrite release | |
13 | * ! gap in HTML tag in POD prevented landing page demo images | |
14 | * ? final touches on new POD documentation | |
15 | ||
16 | 2.403.5 2022-07-18 lichtkind | |
7 | 17 | ------- |
8 | 18 | * = POD rewrite release |
9 | 19 | * ? completed workflow page in manual |
10 | 20 | * ? completed methods page in manual |
11 | 21 | |
12 | 2.403.4 2022-08-17 lichtkind | |
22 | 2.403.4 2022-07-17 lichtkind | |
13 | 23 | ------- |
14 | 24 | * = POD rewrite release |
15 | 25 | * ? completed types page in manual |
16 | 26 | * ! fixed some image sizes |
17 | 27 | * ! fixed dist.ini so old stuff from git don't spill into release |
18 | 28 | |
19 | 2.403.3 2022-08-16 lichtkind | |
29 | 2.403.3 2022-07-16 lichtkind | |
20 | 30 | ------- |
21 | 31 | * = POD rewrite release |
22 | 32 | * + addded images to landing page |
25 | 35 | * ? some small addons for properties page |
26 | 36 | * ! fixed overlong tick label due rounding error near zero |
27 | 37 | |
28 | 2.403.2 2022-08-13 lichtkind | |
38 | 2.403.2 2022-07-13 lichtkind | |
29 | 39 | ------- |
30 | 40 | * = POD rewrite release |
31 | 41 | * ? completed properties page in manual |
32 | 42 | * ? started types page in manual with first test example |
33 | 43 | * ! linkfixes on landing POD of Chart.pm |
34 | * ! linkfixes on Color::Constants.pm POD | |
35 | ||
36 | 2.403.1 2022-08-12 lichtkind | |
44 | * ! linkfixes on Color::Constant.pm POD | |
45 | ||
46 | 2.403.1 2022-07-12 lichtkind | |
37 | 47 | ------- |
38 | 48 | * = POD rewrite release |
39 | 49 | * ? completed most of properties |
40 | * ? all names listed in Color::Constants.POD | |
41 | ||
42 | 2.403.0 2022-08-07 lichtkind | |
50 | * ? all names listed in Color::Constant.pm POD | |
51 | ||
52 | 2.403.0 2022-07-07 lichtkind | |
43 | 53 | ------- |
44 | 54 | * = test release to check metacpan POD parser |
45 | 55 | * + added Chart::Manual + property sub page |
46 | 56 | * - drop PDF and HTML documentation |
47 | 57 | * - drop dependency on module: POSIX |
48 | 58 | |
49 | 2.402.3 2022-07-18 lichtkind | |
59 | 2.402.3 2022-06-18 lichtkind | |
50 | 60 | ------- |
51 | 61 | * + string method to Color objects |
52 | 62 | * ? fixed #18891 : document that y_ticks1, y_ticks2 is composite only |
20 | 20 | lib/Chart/Constants.pm |
21 | 21 | lib/Chart/Direction.pm |
22 | 22 | lib/Chart/ErrorBars.pm |
23 | lib/Chart/Font.pm | |
24 | 23 | lib/Chart/HorizontalBars.pm |
25 | 24 | lib/Chart/Lines.pm |
26 | 25 | lib/Chart/LinesPoints.pm |
34 | 33 | lib/Chart/Pie.pm |
35 | 34 | lib/Chart/Points.pm |
36 | 35 | lib/Chart/Property.pm |
36 | lib/Chart/Property/DataType/Font.pm | |
37 | 37 | lib/Chart/Split.pm |
38 | 38 | lib/Chart/StackedBars.pm |
39 | 39 | t/001_color_value.t |
53 | 53 | "provides" : { |
54 | 54 | "Chart" : { |
55 | 55 | "file" : "lib/Chart.pm", |
56 | "version" : "v2.403.6" | |
56 | "version" : "v2.403.7" | |
57 | 57 | }, |
58 | 58 | "Chart::Bars" : { |
59 | 59 | "file" : "lib/Chart/Bars.pm", |
60 | "version" : "v2.403.6" | |
60 | "version" : "v2.403.7" | |
61 | 61 | }, |
62 | 62 | "Chart::Color" : { |
63 | 63 | "file" : "lib/Chart/Color.pm", |
64 | "version" : "v2.403.6" | |
64 | "version" : "v2.403.7" | |
65 | 65 | }, |
66 | 66 | "Chart::Composite" : { |
67 | 67 | "file" : "lib/Chart/Composite.pm", |
68 | "version" : "v2.403.6" | |
68 | "version" : "v2.403.7" | |
69 | 69 | }, |
70 | 70 | "Chart::Direction" : { |
71 | 71 | "file" : "lib/Chart/Direction.pm", |
72 | "version" : "v2.403.6" | |
72 | "version" : "v2.403.7" | |
73 | 73 | }, |
74 | 74 | "Chart::ErrorBars" : { |
75 | 75 | "file" : "lib/Chart/ErrorBars.pm", |
76 | "version" : "v2.403.6" | |
77 | }, | |
78 | "Chart::Font" : { | |
79 | "file" : "lib/Chart/Font.pm", | |
80 | "version" : "v2.403.6" | |
76 | "version" : "v2.403.7" | |
81 | 77 | }, |
82 | 78 | "Chart::HorizontalBars" : { |
83 | 79 | "file" : "lib/Chart/HorizontalBars.pm", |
84 | "version" : "v2.403.6" | |
80 | "version" : "v2.403.7" | |
85 | 81 | }, |
86 | 82 | "Chart::Lines" : { |
87 | 83 | "file" : "lib/Chart/Lines.pm", |
88 | "version" : "v2.403.6" | |
84 | "version" : "v2.403.7" | |
89 | 85 | }, |
90 | 86 | "Chart::LinesPoints" : { |
91 | 87 | "file" : "lib/Chart/LinesPoints.pm", |
92 | "version" : "v2.403.6" | |
88 | "version" : "v2.403.7" | |
93 | 89 | }, |
94 | 90 | "Chart::Mountain" : { |
95 | 91 | "file" : "lib/Chart/Mountain.pm", |
96 | "version" : "v2.403.6" | |
92 | "version" : "v2.403.7" | |
97 | 93 | }, |
98 | 94 | "Chart::Pareto" : { |
99 | 95 | "file" : "lib/Chart/Pareto.pm", |
100 | "version" : "v2.403.6" | |
96 | "version" : "v2.403.7" | |
101 | 97 | }, |
102 | 98 | "Chart::Pie" : { |
103 | 99 | "file" : "lib/Chart/Pie.pm", |
104 | "version" : "v2.403.6" | |
100 | "version" : "v2.403.7" | |
105 | 101 | }, |
106 | 102 | "Chart::Points" : { |
107 | 103 | "file" : "lib/Chart/Points.pm", |
108 | "version" : "v2.403.6" | |
104 | "version" : "v2.403.7" | |
109 | 105 | }, |
110 | 106 | "Chart::Property" : { |
111 | 107 | "file" : "lib/Chart/Property.pm", |
112 | "version" : "v2.403.6" | |
108 | "version" : "v2.403.7" | |
109 | }, | |
110 | "Chart::Property::DataType::Font" : { | |
111 | "file" : "lib/Chart/Property/DataType/Font.pm", | |
112 | "version" : "v2.403.7" | |
113 | 113 | }, |
114 | 114 | "Chart::Split" : { |
115 | 115 | "file" : "lib/Chart/Split.pm", |
116 | "version" : "v2.403.6" | |
116 | "version" : "v2.403.7" | |
117 | 117 | }, |
118 | 118 | "Chart::StackedBars" : { |
119 | 119 | "file" : "lib/Chart/StackedBars.pm", |
120 | "version" : "v2.403.6" | |
120 | "version" : "v2.403.7" | |
121 | 121 | } |
122 | 122 | }, |
123 | 123 | "release_status" : "stable", |
128 | 128 | "web" : "https://github.com/lichtkind/Chart" |
129 | 129 | } |
130 | 130 | }, |
131 | "version" : "v2.403.6", | |
131 | "version" : "v2.403.7", | |
132 | 132 | "x_generated_by_perl" : "v5.30.0", |
133 | 133 | "x_maintainers" : [ |
134 | 134 | "Herbert Breunung <lichtkind@cpan.org>" |
27 | 27 | provides: |
28 | 28 | Chart: |
29 | 29 | file: lib/Chart.pm |
30 | version: v2.403.6 | |
30 | version: v2.403.7 | |
31 | 31 | Chart::Bars: |
32 | 32 | file: lib/Chart/Bars.pm |
33 | version: v2.403.6 | |
33 | version: v2.403.7 | |
34 | 34 | Chart::Color: |
35 | 35 | file: lib/Chart/Color.pm |
36 | version: v2.403.6 | |
36 | version: v2.403.7 | |
37 | 37 | Chart::Composite: |
38 | 38 | file: lib/Chart/Composite.pm |
39 | version: v2.403.6 | |
39 | version: v2.403.7 | |
40 | 40 | Chart::Direction: |
41 | 41 | file: lib/Chart/Direction.pm |
42 | version: v2.403.6 | |
42 | version: v2.403.7 | |
43 | 43 | Chart::ErrorBars: |
44 | 44 | file: lib/Chart/ErrorBars.pm |
45 | version: v2.403.6 | |
46 | Chart::Font: | |
47 | file: lib/Chart/Font.pm | |
48 | version: v2.403.6 | |
45 | version: v2.403.7 | |
49 | 46 | Chart::HorizontalBars: |
50 | 47 | file: lib/Chart/HorizontalBars.pm |
51 | version: v2.403.6 | |
48 | version: v2.403.7 | |
52 | 49 | Chart::Lines: |
53 | 50 | file: lib/Chart/Lines.pm |
54 | version: v2.403.6 | |
51 | version: v2.403.7 | |
55 | 52 | Chart::LinesPoints: |
56 | 53 | file: lib/Chart/LinesPoints.pm |
57 | version: v2.403.6 | |
54 | version: v2.403.7 | |
58 | 55 | Chart::Mountain: |
59 | 56 | file: lib/Chart/Mountain.pm |
60 | version: v2.403.6 | |
57 | version: v2.403.7 | |
61 | 58 | Chart::Pareto: |
62 | 59 | file: lib/Chart/Pareto.pm |
63 | version: v2.403.6 | |
60 | version: v2.403.7 | |
64 | 61 | Chart::Pie: |
65 | 62 | file: lib/Chart/Pie.pm |
66 | version: v2.403.6 | |
63 | version: v2.403.7 | |
67 | 64 | Chart::Points: |
68 | 65 | file: lib/Chart/Points.pm |
69 | version: v2.403.6 | |
66 | version: v2.403.7 | |
70 | 67 | Chart::Property: |
71 | 68 | file: lib/Chart/Property.pm |
72 | version: v2.403.6 | |
69 | version: v2.403.7 | |
70 | Chart::Property::DataType::Font: | |
71 | file: lib/Chart/Property/DataType/Font.pm | |
72 | version: v2.403.7 | |
73 | 73 | Chart::Split: |
74 | 74 | file: lib/Chart/Split.pm |
75 | version: v2.403.6 | |
75 | version: v2.403.7 | |
76 | 76 | Chart::StackedBars: |
77 | 77 | file: lib/Chart/StackedBars.pm |
78 | version: v2.403.6 | |
78 | version: v2.403.7 | |
79 | 79 | requires: |
80 | 80 | Carp: '1.35' |
81 | 81 | GD: '2' |
82 | 82 | perl: v5.12.0 |
83 | 83 | resources: |
84 | 84 | repository: git://github.com/lichtkind/Chart.git |
85 | version: v2.403.6 | |
85 | version: v2.403.7 | |
86 | 86 | x_generated_by_perl: v5.30.0 |
87 | 87 | x_maintainers: |
88 | 88 | - 'Herbert Breunung <lichtkind@cpan.org>' |
24 | 24 | "Test::More" => "1.3", |
25 | 25 | "Test::Warn" => "0.30" |
26 | 26 | }, |
27 | "VERSION" => "v2.403.6", | |
27 | "VERSION" => "v2.403.7", | |
28 | 28 | "test" => { |
29 | 29 | "TESTS" => "t/*.t" |
30 | 30 | } |
35 | 35 | $imagemap_ref = $obj->imagemap_dump (); |
36 | 36 | |
37 | 37 | DESCRIPTION |
38 | Chart help you to create PNG and JPG images with visualizations of | |
38 | Chart helps you to create PNG and JPG images with visualizations of | |
39 | 39 | numeric data. This page gives you a summary how to use it. For a more |
40 | 40 | thorough documentation and lots of example code please visit the |
41 | 41 | Chart::Manual. |
50 | 50 | |
51 | 51 | use Chart::Lines; |
52 | 52 | |
53 | would invoke the lines module. Alternatively write to load all chart | |
54 | types at ones with | |
53 | would invoke the lines module. Alternatively load all chart types at | |
54 | ones and write: | |
55 | 55 | |
56 | 56 | use Chart; |
57 | 57 | |
118 | 118 | src=image.pl<gt> HTML tag). The @data array should be set up the |
119 | 119 | same way as for the normal png method. |
120 | 120 | |
121 | Graph.pm-style API | |
121 | column based API | |
122 | 122 | You might ask, "But what if I just want to add a few points to the |
123 | 123 | graph, and then display it, without all those references to |
124 | 124 | references?". Well, friend, the solution is simple. Borrowing the add_pt |
0 | 0 | ROADMAP: |
1 | 1 | ------- |
2 | 2 | |
3 | 3.0 rewrite comlete | |
3 | 3.0 rewrite complete | |
4 | 4 | ... |
5 | 5 | |
6 | 6 | 2.406 rewrite axis, tiks, label, box rendering |
9 | 9 | |
10 | 10 | we are here <------------------------------------------------- |
11 | 11 | |
12 | 2.403 dropped old pdf and html and added new POD documentation with embedded HML img | |
12 | 2.403 replaced old pdf and html with new POD documentation with embedded HML img | |
13 | 13 | 2.402 new, powerful color management: HSL, hex_RGB, hash_RGB, Pantone colors |
14 | 14 | 2.401 reformat distribution to be based on Dist::Zilla, solve CPAN issues |
15 | 15 |
4 | 4 | |
5 | 5 | package Chart::Bars; |
6 | 6 | our @ISA = qw(Chart::Base); |
7 | our $VERSION = 'v2.403.6'; | |
7 | our $VERSION = 'v2.403.7'; | |
8 | 8 | |
9 | 9 | use Chart::Base; |
10 | 10 | use GD; |
4 | 4 | use v5.12; |
5 | 5 | |
6 | 6 | package Chart::Base; |
7 | our $VERSION = 'v2.403.6'; | |
7 | our $VERSION = 'v2.403.7'; | |
8 | 8 | |
9 | 9 | use FileHandle; |
10 | 10 | use Carp; |
11 | 11 | use GD; |
12 | 12 | use GD::Image; |
13 | 13 | use Chart::Color; |
14 | #use Chart::Font; | |
14 | #use Property::DataType::Font; | |
15 | 15 | |
16 | 16 | #>>>>>>>>>>>>>>>>>>>>>>>>>># |
17 | 17 | # public methods # |
3 | 3 | use v5.12; |
4 | 4 | |
5 | 5 | package Chart::BrushStyles; |
6 | our $VERSION = 'v2.403.6'; | |
6 | our $VERSION = 'v2.403.7'; | |
7 | 7 | |
8 | 8 | use Carp; |
9 | 9 | use GD; |
2 | 2 | # named colors from X11, HTML (SVG) standard and Pantone report |
3 | 3 | |
4 | 4 | package Chart::Color::Constant; |
5 | our $VERSION = 'v2.403.6'; | |
5 | our $VERSION = 'v2.403.7'; | |
6 | 6 | use Carp; |
7 | 7 | use Chart::Color::Value; |
8 | 8 |
2 | 2 | # check, convert and measure color values |
3 | 3 | |
4 | 4 | package Chart::Color::Value; |
5 | our $VERSION = 'v2.403.6'; | |
5 | our $VERSION = 'v2.403.7'; | |
6 | 6 | use Carp; |
7 | 7 | |
8 | 8 | sub check_rgb { # carp returns 1 |
4 | 4 | use v5.12; |
5 | 5 | |
6 | 6 | package Chart::Color; |
7 | our $VERSION = 'v2.403.6'; | |
7 | our $VERSION = 'v2.403.7'; | |
8 | 8 | |
9 | 9 | use Carp; |
10 | 10 | use Chart::Color::Constant; |
346 | 346 | Name of the color in the X11 or HTML (SVG) standard or the Pantone report. |
347 | 347 | The name will be found and filled in, even when the object is created |
348 | 348 | with RGB or HSL values. If the color is not found in any of the mentioned |
349 | standards, it returns an empty string. | |
349 | standards, it returns an empty string. All names are at: L<Chart::Color::Constant/NAMES> | |
350 | 350 | |
351 | 351 | =head2 string |
352 | 352 |
3 | 3 | |
4 | 4 | package Chart::Composite; |
5 | 5 | our @ISA = qw(Chart::Base); |
6 | our $VERSION = 'v2.403.6'; | |
6 | our $VERSION = 'v2.403.7'; | |
7 | 7 | |
8 | 8 | use Chart::Base; |
9 | 9 | use GD; |
3 | 3 | use v5.12; |
4 | 4 | |
5 | 5 | package Chart::Constants; |
6 | our $VERSION = 'v2.403.6'; | |
6 | our $VERSION = 'v2.403.7'; | |
7 | 7 | |
8 | 8 | use constant PI => 4 * atan2( 1, 1 ); |
9 | 9 |
4 | 4 | |
5 | 5 | package Chart::Direction; |
6 | 6 | our @ISA = qw(Chart::Base); |
7 | our $VERSION = 'v2.403.6'; | |
7 | our $VERSION = 'v2.403.7'; | |
8 | 8 | |
9 | 9 | use Chart::Base; |
10 | 10 | use GD; |
5 | 5 | |
6 | 6 | package Chart::ErrorBars; |
7 | 7 | our @ISA = qw(Chart::Base); |
8 | our $VERSION = 'v2.403.6'; | |
8 | our $VERSION = 'v2.403.7'; | |
9 | 9 | |
10 | 10 | use Chart::Base; |
11 | 11 | use GD; |
0 | ||
1 | # | |
2 | ||
3 | use v5.12; | |
4 | ||
5 | package Chart::Font; | |
6 | our $VERSION = 'v2.403.6'; | |
7 | ||
8 | use Carp; | |
9 | ||
10 | ## constructor ######################################################### | |
11 | ||
12 | sub new { | |
13 | my $pkg = shift; | |
14 | my $def = shift; | |
15 | return unless ref $def eq 'HASH'; | |
16 | bless {}; | |
17 | } | |
18 | ||
19 | ## getter ############################################################## | |
20 | ||
21 | sub name { | |
22 | ||
23 | } | |
24 | ||
25 | sub bold { | |
26 | ||
27 | } | |
28 | ||
29 | sub size { | |
30 | ||
31 | } | |
32 | ||
33 | sub unicode { | |
34 | } | |
35 | ||
36 | sub truetype { | |
37 | ||
38 | } | |
39 | ||
40 | ||
41 | 1; | |
42 | ||
43 | __END__ | |
44 | ||
45 | =pod | |
46 | ||
47 | =head1 NAME | |
48 | ||
49 | Chart::Font - read only single font holding objects | |
50 | ||
51 | =head1 SYNOPSIS | |
52 | ||
53 | my $red = Chart::Color->new('red'); | |
54 | say $red->add('blue')->name; # magenta, mixed in RGB space | |
55 | Chart::Color->new( 0, 0, 255)->hsl # 240, 100, 50 = blue | |
56 | $blue->blend_with({H=> 0, S=> 0, L=> 80}, 0.1);# mix blue with a little grey | |
57 | $red->gradient( '#0000FF', 10); # 10 colors from red to blue | |
58 | $red->complementary( 3 ); # get fitting red green and blue | |
59 | ||
60 | =head1 DESCRIPTION | |
61 | ||
62 | ||
63 | ||
64 | =head1 COPYRIGHT & LICENSE | |
65 | ||
66 | Copyright 2022 Herbert Breunung. | |
67 | ||
68 | This program is free software; you can redistribute it and/or modify it | |
69 | under same terms as Perl itself. | |
70 | ||
71 | =head1 AUTHOR | |
72 | ||
73 | Herbert Breunung, <lichtkind@cpan.org> | |
74 | ||
75 | =cut | |
76 | ||
77 | ||
78 | __END__ | |
79 | $im->string( GD::Font->Tiny , 20, 20, 'Tiny', 2); | |
80 | $im->string( GD::Font->Small , 20, 50, 'Small', 1); | |
81 | $im->string( GD::Font->MediumBold , 20, 80, 'MediumBold', 2); | |
82 | $im->string( GD::Font->Large , 20, 110, 'Large', 1); | |
83 | $im->string( GD::Font->Giant , 20, 140, 'Giant', 2); | |
84 | ||
85 | gdTinyFont | |
86 | gdSmallFont | |
87 | gdMediumBoldFont | |
88 | gdLargeFont | |
89 | gdGiantFont |
2 | 2 | |
3 | 3 | package Chart::HorizontalBars; |
4 | 4 | our @ISA = qw(Chart::Base); |
5 | our $VERSION = 'v2.403.6'; | |
5 | our $VERSION = 'v2.403.7'; | |
6 | 6 | |
7 | 7 | use Chart::Base; |
8 | 8 | use GD; |
4 | 4 | |
5 | 5 | package Chart::Lines; |
6 | 6 | our @ISA = qw(Chart::Base); |
7 | our $VERSION = 'v2.403.6'; | |
7 | our $VERSION = 'v2.403.7'; | |
8 | 8 | |
9 | 9 | use Chart::Base; |
10 | 10 | use GD; |
7 | 7 | |
8 | 8 | package Chart::LinesPoints; |
9 | 9 | our @ISA = qw(Chart::Base); |
10 | our $VERSION = 'v2.403.6'; | |
10 | our $VERSION = 'v2.403.7'; | |
11 | 11 | |
12 | 12 | use Chart::Base; |
13 | 13 | use GD; |
11 | 11 | $chart_object->set( %properties); |
12 | 12 | $chart_object->set( key => 'value', ... ); |
13 | 13 | |
14 | This page documents all viable keys and values for this method. | |
14 | This page documents all viable keys and values for this calls. | |
15 | ||
15 | 16 | The first section lists the most common data types and their acceptable |
16 | 17 | values. |
17 | 18 | |
18 | Please note that every chart L<type|Chart::Manual::Types> reacts only to | |
19 | a distinct property subset. The L<section section|/"BY CHART TYPE"> | |
19 | Please note that all chart L<type|Chart::Manual::Types> reacts only to | |
20 | a distinct subset of properties. The L<section section|/"BY CHART TYPE"> | |
20 | 21 | therefore groups all properties by chart type or set of types, where they |
21 | 22 | have an effect. The descriptions in this section are shortened to achive |
22 | 23 | a tabular overview. |
24 | 25 | A fuller description of each property provides the |
25 | 26 | L<third section|/ALPHABETICALLY>, where they are alpabetically sorted. |
26 | 27 | |
28 | The general layout of a chart image: | |
29 | ||
30 | =for HTML <p> | |
31 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/manual/layout.png" alt="layout"> | |
32 | </p> | |
27 | 33 | |
28 | 34 | =head1 DATA TYPES |
29 | 35 | |
73 | 79 | |
74 | 80 | =head2 integer |
75 | 81 | |
76 | Whole numbers (without decimals) to set position, size and alike | |
82 | Whole numbers (without decimals) to set position, size and alike. | |
77 | 83 | |
78 | 84 | =head2 positive integer |
79 | 85 | |
459 | 465 | |
460 | 466 | Lets Chart know you're going to ask for information about the placement |
461 | 467 | of the data for use in creating an image map from the png. This information |
462 | can be retrieved using the imagemap_dump() method. NB. that the | |
463 | imagemap_dump() method cannot be called until after the Chart has been | |
464 | generated (ie. using the png() or cgi_png() methods). | |
468 | can be retrieved using the L<imagemap_dump()|Chart::Manual::Methods/imagemap_dump> | |
469 | method. NB. that the imagemap_dump() method cannot be called until after | |
470 | the Chart has been L<generated|"/Chart::Manual::Workflows/create image">. | |
465 | 471 | |
466 | 472 | =head2 include_zero |
467 | 473 |
20 | 20 | which are width and height of the later generated image. |
21 | 21 | |
22 | 22 | |
23 | =head1 Bars | |
23 | =head2 Bars | |
24 | 24 | |
25 | 25 | =for HTML <p> |
26 | 26 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/manual/bars.png" alt="dual bar chart" width="500" height="300"> |
69 | 69 | $g->png("bars.png"); |
70 | 70 | |
71 | 71 | |
72 | =head1 Composite | |
72 | =head2 Composite | |
73 | 73 | |
74 | 74 | =for HTML <p> |
75 | 75 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/manual/composite.png" alt="composite chart"> |
112 | 112 | $g->png("composite.png"); |
113 | 113 | |
114 | 114 | |
115 | =head1 Direction | |
115 | =head2 Direction | |
116 | 116 | |
117 | 117 | =for HTML <p> |
118 | 118 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/manual/direction.png" alt="polar chart"> |
175 | 175 | $g->png("direction.png"); |
176 | 176 | |
177 | 177 | |
178 | =head1 ErrorBars | |
178 | =head2 ErrorBars | |
179 | 179 | |
180 | 180 | =for HTML <p> |
181 | 181 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/manual/error.png" alt="error bar chart"> |
222 | 222 | $g->png("error.png"); |
223 | 223 | |
224 | 224 | |
225 | =head1 HorizontalBars | |
225 | =head2 HorizontalBars | |
226 | 226 | |
227 | 227 | =for HTML <p> |
228 | 228 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/manual/hbars.png" alt="horizontal bar chart"> |
232 | 232 | Same rules apply as in L</Bars>, except due negative values in our data sets |
233 | 233 | here L<min_val|Chart::Manual::Properties/min_val> doesn't have to be set to zero. |
234 | 234 | And instead of L<y_grid_lines|Chart::Manual::Properties/y_grid_lines> |
235 | we activate and color L<x_grid_lines|Chart::Manual::Properties/x_grid_lines> | |
236 | ||
235 | we activate and color L<x_grid_lines|Chart::Manual::Properties/x_grid_lines>. | |
236 | Deactivating the grey background of the plot just adds a little friendliness. | |
237 | 237 | |
238 | 238 | use Chart::HorizontalBars; |
239 | 239 | |
255 | 255 | y_label => 'gray40', |
256 | 256 | title => 'gray20', |
257 | 257 | } |
258 | grey_background => 'false', | |
258 | 259 | ); |
259 | 260 | $g->png("hbars.png"); |
260 | 261 | |
296 | 297 | $g->png("lines.png"); |
297 | 298 | |
298 | 299 | |
299 | =head1 LinesPoints | |
300 | =head2 LinesPoints | |
300 | 301 | |
301 | 302 | =for HTML <p> |
302 | 303 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/manual/linespoints.png" alt="xy chart with connected points"> |
313 | 314 | and L<y_label|Chart::Manual::Properties/y_label> and set L<xy_plot|Chart::Manual::Properties/xy_plot> |
314 | 315 | off, which is not really needed, since it is on C<'false'> per default. |
315 | 316 | This allows you to give the x-axis none numerical, custom tick labels, |
316 | which are by accident the numbers 1 .. 18, as the first data row shows. | |
317 | which are by accident the numbers 1 .. 17, as the first data row shows. | |
317 | 318 | The purpose of this maneuver is to not have zero as the first column label. |
318 | 319 | |
319 | 320 | Because the origin of coordinate system is usually in the left lower |
332 | 333 | |
333 | 334 | my $g = Chart::LinesPoints->new( 600, 300 ); |
334 | 335 | $g->set( |
335 | 'title' => 'Soccer Season 2002', | |
336 | 'legend_labels' => ['NY Soccer Club', 'Denver Tigers', | |
337 | 'Houston Spacecats', 'Washington Presidents'], | |
338 | 'y_label' => 'position in the table', | |
339 | 'x_label' => 'day of play', | |
340 | 'grid_lines' => 'true', | |
341 | 'f_y_tick' => sub { - $_[0] }, | |
342 | # 'xy_plot' => 'false', | |
343 | 'integer_ticks_only' => 'true', | |
336 | title => 'Soccer Season 2002', | |
337 | legend_labels => ['NY Soccer Club', 'Denver Tigers', | |
338 | 'Houston Spacecats', 'Washington Presidents'], | |
339 | y_label => 'position in the table', | |
340 | x_label => 'day of play', | |
341 | grid_lines => 'true', | |
342 | f_y_tick => sub { - $_[0] }, | |
343 | # xy_plot => 'true', | |
344 | integer_ticks_only => 'true', | |
345 | colors => { | |
346 | grid_lines => 'gray70', | |
347 | }, | |
344 | 348 | ); |
345 | 349 | $g->png("linespoints.png", [ |
346 | 350 | [qw(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17)], |
351 | 355 | ]); |
352 | 356 | |
353 | 357 | |
354 | =head1 Mountain | |
358 | =head2 Mountain | |
355 | 359 | |
356 | 360 | =for HTML <p> |
357 | 361 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/manual/mountain.png" alt="mountain chart"> |
401 | 405 | $g->png( 'mountain.png', \@data ); |
402 | 406 | |
403 | 407 | |
404 | =head1 Pareto | |
408 | =head2 Pareto | |
405 | 409 | |
406 | 410 | =for HTML <p> |
407 | 411 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/manual/pareto.png" alt="pareto chart"> |
412 | 416 | only one), while the line represent the accumulation (sum of all values |
413 | 417 | from the start on the left up to this value). For a better orientation |
414 | 418 | the absolute values should be sorted. In case your data set is not already, |
415 | change the property <sort|Chart::Manual::Properties/sort> to C<'true'>. | |
419 | change the property L<sort|Chart::Manual::Properties/sort> to C<'true'>. | |
416 | 420 | (Note that the days of the week are not in chronological order, |
417 | 421 | but in the order of decreasing sale amounts.) The first given data set |
418 | 422 | is like in most cases the domain (x-axis labels). So the color of the first |
419 | 423 | data set containing numbers has the color of |
420 | 424 | L<dataset0|Chart::Manual::Properties/colors-datasetx> and the accumulation |
421 | 425 | gets the color of dataset1 (which are per default also red and green, |
422 | but in reverse order). | |
426 | but in reverse order). We choose a Pantone Report designer red, which | |
427 | sticks out but is not too shrill. | |
423 | 428 | |
424 | 429 | For better optics we set L<spaced_bars|Chart::Manual::Properties/spaced_bars> |
425 | 430 | off, so that the bars touch each other and give a nice counterweight to |
449 | 454 | colors => { |
450 | 455 | title => 'darkblue', |
451 | 456 | dataset0 => 'green', |
452 | dataset1 => 'red', | |
453 | x_label => 'red', | |
457 | dataset1 => 'aurorared', | |
458 | x_label => 'aurorared', | |
454 | 459 | y_grid_lines => 'white', |
455 | 460 | }, |
456 | 461 | ); |
457 | 462 | $g->png("pareto.png"); |
458 | 463 | |
459 | 464 | |
460 | =head1 Pie | |
465 | =head2 Pie | |
461 | 466 | |
462 | 467 | =for HTML <p> |
463 | 468 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/manual/pie.png" alt="pie chart"> |
465 | 470 | |
466 | 471 | The class Chart::Pie creates a pie or ring chart. The first added data |
467 | 472 | set must contain the labels and the second set the values. Our example |
468 | displays a ring chart with a thickness of 35% (of the radius). | |
469 | If the L<ring|Chart::Manual::Properties/ring> property is omitted, | |
470 | the chart falls back to regular pie. Every ring slice is labeled with the | |
471 | stated label, plus the percentage of its value, as defined with the property | |
473 | displays a ring chart with a thickness of 35% (of the radius). If the | |
474 | L<ring|Chart::Manual::Properties/ring> property is omitted, the chart form | |
475 | falls back to regular pie. Every ring slice is labeled with the stated label, | |
476 | plus the percentage of its value, as defined with the property | |
472 | 477 | L<label_values|Chart::Manual::Properties/label_values>. Connecting lines |
473 | 478 | between label and slice are drawn because L<legend_lines|Chart::Manual::Properties/legend_lines> |
474 | 479 | is set to C<'true'>. The actual legend is placed on the bottom, in order |
479 | 484 | correlated with a color, here every slice has to have its own color. |
480 | 485 | Thats why the first data point has the color of L<dataset0|Chart::Manual::Properties/colors-datasetx> |
481 | 486 | the second of dataset1 and so forth. In most cases the default colors |
482 | are good enough unless you have special meanings in mind. Please also | |
487 | are good enough, unless you have special meanings in mind. Please also | |
483 | 488 | note the multi line (row) title text. |
484 | 489 | |
485 | 490 | |
495 | 500 | 'legend_lines' => 'true', |
496 | 501 | 'ring' => 0.35, |
497 | 502 | ); |
498 | ||
499 | 503 | $g->png("pie.png"); |
500 | 504 | |
501 | 505 | |
502 | =head1 Points | |
506 | =head2 Points | |
503 | 507 | |
504 | 508 | =for HTML <p> |
505 | 509 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/manual/points.png" alt="xy chart with points"> |
519 | 523 | decimals on the y-axis labels and keeps it clean. The method C<add_pt> |
520 | 524 | appends to every data set another value, adding another column to the chart. |
521 | 525 | L<png_border|Chart::Manual::Properties/png_border> does just adds frame |
522 | of 10 pixel width around the entire image. | |
526 | of 10 pixel width around the entire image. They middle gray grid lines | |
527 | are just easy for the eyes. | |
523 | 528 | |
524 | 529 | use Chart::Points; |
525 | 530 | |
536 | 541 | precision => 0, |
537 | 542 | grid_lines => 'true', |
538 | 543 | png_border => 10, |
544 | colors => { | |
545 | grid_lines => 'gray70', | |
546 | ||
547 | }, | |
539 | 548 | ); |
540 | 549 | $g->png("points.png"); |
541 | 550 | |
542 | 551 | |
543 | =head1 Split | |
552 | =head2 Split | |
544 | 553 | |
545 | 554 | =for HTML <p> |
546 | 555 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/manual/split.png" alt="multi chart"> |
596 | 605 | The class Chart::StackedBars is a variant of L</Bars> that stacks |
597 | 606 | bars belonging to one x-value on top of each other, instead of putting |
598 | 607 | them beside each other. Data sets 0..n are ordered from the bottom up. |
599 | They are in most cases more intuitive than L</Pie> charts. | |
608 | They are in most cases more intuitive than L</Pie> charts, because its | |
609 | easier to intuit linear than quadratic ratios. As in the Bars example we | |
610 | activated horizontal grid lines, which were subtle colored. To surpress | |
611 | decimals on the y-axis L<precision|Chart::Manual::Properties/precision> was turned down. | |
612 | And as in most cases - the first data set is the domain, which will be | |
613 | drawn as x-axis labels. | |
600 | 614 | |
601 | 615 | use Chart::StackedBars; |
602 | 616 | |
609 | 623 | title => 'Stacked Bars', |
610 | 624 | legend => 'left', |
611 | 625 | precision => 0, |
626 | y_grid_lines => 'true', | |
612 | 627 | grey_background => 'false', |
613 | colors => { | |
614 | x_grid_lines => 'gray70', | |
628 | colors => { | |
629 | grid_lines => 'gray80', | |
615 | 630 | misc => 'gray55', |
616 | 631 | text => 'gray55', |
617 | 632 | x_label => 'gray40', |
54 | 54 | that create the final image, take as an optional, second argument data. |
55 | 55 | This data may be delivered either as a reference to an array of arrays: |
56 | 56 | |
57 | my $data = [ [ 1, 4, 3 ... <data set 0> ], [ <data set 1> ], ... ]; | |
57 | my $data = [ [ 1, 4, 3 ... ], # data set 0 | |
58 | [ 5, 8, 2 ... ], # data set 1 | |
59 | ... | |
60 | ]; | |
58 | 61 | $graph->png( 'file.png', $data ); |
59 | 62 | |
60 | 63 | or in form of a file. Then the argument has to be a file name or a |
33 | 33 | |
34 | 34 | The method C<set> allows to directly change particular chart properties. |
35 | 35 | All of these explained in detail with their acceptable and default values |
36 | are sorted there by name or topic or type: | |
36 | are sorted there by name and topic or type: | |
37 | 37 | |
38 | 38 | L<Chart::Manual::Properties> |
39 | 39 | |
42 | 42 | |
43 | 43 | Much of what is documented here will be superseded by a new API provided |
44 | 44 | by upcoming version 3.0. The old API will be discouraged but not deprecated, |
45 | except maybe the module Chart::Composite. | |
46 | ||
45 | except maybe the module Chart::Composite and some properties. | |
46 | The new API will aply only to objects created by Chart-E<gt>new(...); | |
47 | 47 | |
48 | 48 | =head1 COPYRIGHT & LICENSE |
49 | 49 |
23 | 23 | |
24 | 24 | package Chart::Mountain; |
25 | 25 | our @ISA = qw(Chart::Base); |
26 | our $VERSION = 'v2.403.6'; | |
26 | our $VERSION = 'v2.403.7'; | |
27 | 27 | |
28 | 28 | use Chart::Base; |
29 | 29 | use GD; |
1 | 1 | |
2 | 2 | package Chart::Pareto; |
3 | 3 | our @ISA = qw(Chart::Base); |
4 | our $VERSION = 'v2.403.6'; | |
4 | our $VERSION = 'v2.403.7'; | |
5 | 5 | |
6 | 6 | use Chart::Base; |
7 | 7 | use GD; |
4 | 4 | |
5 | 5 | package Chart::Pie; |
6 | 6 | our @ISA = qw(Chart::Base); |
7 | our $VERSION = 'v2.403.6'; | |
7 | our $VERSION = 'v2.403.7'; | |
8 | 8 | |
9 | 9 | use Carp; |
10 | 10 | use GD; |
4 | 4 | |
5 | 5 | package Chart::Points; |
6 | 6 | our @ISA = qw(Chart::Base); |
7 | our $VERSION = 'v2.403.6'; | |
7 | our $VERSION = 'v2.403.7'; | |
8 | 8 | |
9 | 9 | use Carp; |
10 | 10 | use GD; |
0 | ||
1 | # | |
2 | ||
3 | use v5.12; | |
4 | ||
5 | package Chart::Property::DataType::Font; | |
6 | our $VERSION = 'v2.403.7'; | |
7 | ||
8 | use Carp; | |
9 | ||
10 | ## constructor ######################################################### | |
11 | ||
12 | sub new { | |
13 | my $pkg = shift; | |
14 | my $def = shift; | |
15 | return unless ref $def eq 'HASH'; | |
16 | bless {}; | |
17 | } | |
18 | ||
19 | ## getter ############################################################## | |
20 | ||
21 | sub name { | |
22 | ||
23 | } | |
24 | ||
25 | sub bold { | |
26 | ||
27 | } | |
28 | ||
29 | sub size { | |
30 | ||
31 | } | |
32 | ||
33 | sub unicode { | |
34 | } | |
35 | ||
36 | sub truetype { | |
37 | ||
38 | } | |
39 | ||
40 | ||
41 | 1; | |
42 | ||
43 | __END__ | |
44 | ||
45 | =pod | |
46 | ||
47 | =head1 NAME | |
48 | ||
49 | Chart::Font - read only single font holding objects | |
50 | ||
51 | =head1 SYNOPSIS | |
52 | ||
53 | my $red = Chart::Color->new('red'); | |
54 | say $red->add('blue')->name; # magenta, mixed in RGB space | |
55 | Chart::Color->new( 0, 0, 255)->hsl # 240, 100, 50 = blue | |
56 | $blue->blend_with({H=> 0, S=> 0, L=> 80}, 0.1);# mix blue with a little grey | |
57 | $red->gradient( '#0000FF', 10); # 10 colors from red to blue | |
58 | $red->complementary( 3 ); # get fitting red green and blue | |
59 | ||
60 | =head1 DESCRIPTION | |
61 | ||
62 | ||
63 | ||
64 | =head1 COPYRIGHT & LICENSE | |
65 | ||
66 | Copyright 2022 Herbert Breunung. | |
67 | ||
68 | This program is free software; you can redistribute it and/or modify it | |
69 | under same terms as Perl itself. | |
70 | ||
71 | =head1 AUTHOR | |
72 | ||
73 | Herbert Breunung, <lichtkind@cpan.org> | |
74 | ||
75 | =cut | |
76 | ||
77 | ||
78 | __END__ | |
79 | $im->string( GD::Font->Tiny , 20, 20, 'Tiny', 2); | |
80 | $im->string( GD::Font->Small , 20, 50, 'Small', 1); | |
81 | $im->string( GD::Font->MediumBold , 20, 80, 'MediumBold', 2); | |
82 | $im->string( GD::Font->Large , 20, 110, 'Large', 1); | |
83 | $im->string( GD::Font->Giant , 20, 140, 'Giant', 2); | |
84 | ||
85 | gdTinyFont | |
86 | gdSmallFont | |
87 | gdMediumBoldFont | |
88 | gdLargeFont | |
89 | gdGiantFont |
3 | 3 | use v5.12; |
4 | 4 | |
5 | 5 | package Chart::Property; |
6 | our $VERSION = 'v2.403.6'; | |
6 | our $VERSION = 'v2.403.7'; | |
7 | 7 | |
8 | 8 | use Carp; |
9 | 9 |
17 | 17 | |
18 | 18 | package Chart::Split; |
19 | 19 | our @ISA = qw(Chart::Base); |
20 | our $VERSION = 'v2.403.6'; | |
20 | our $VERSION = 'v2.403.7'; | |
21 | 21 | |
22 | 22 | use Chart::Base; |
23 | 23 | use GD; |
1 | 1 | |
2 | 2 | package Chart::StackedBars; |
3 | 3 | our @ISA = qw(Chart::Base); |
4 | our $VERSION = 'v2.403.6'; | |
4 | our $VERSION = 'v2.403.7'; | |
5 | 5 | |
6 | 6 | use Chart::Base; |
7 | 7 | use GD; |
0 | 0 | use v5.12; |
1 | 1 | |
2 | 2 | package Chart; |
3 | our $VERSION = 'v2.403.6'; | |
3 | our $VERSION = 'v2.403.7'; | |
4 | 4 | |
5 | 5 | use Chart::Points; |
6 | 6 | use Chart::Lines; |
65 | 65 | |
66 | 66 | =head1 DESCRIPTION |
67 | 67 | |
68 | Chart help you to create PNG and JPG images with visualizations of numeric data. | |
68 | Chart helps you to create PNG and JPG images with visualizations of numeric data. | |
69 | 69 | This page gives you a summary how to use it. |
70 | 70 | For a more thorough documentation and lots of example code please visit the L<Chart::Manual>. |
71 | 71 | |
72 | 72 | |
73 | 73 | =for HTML <p> |
74 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/manual/points.png" alt="point chart" width="300" height="225"> | |
75 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/test/composite_f.png" alt="composite of bars and lines" width="300" height="225"> | |
76 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/test/stackedbars.png" alt="stacked bars" width="300" height="200"> | |
77 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/test/bars_2.png" alt="multi bar chart" width="300" height="250"> | |
78 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/test/hbars_2.png" alt="horizontal bar chart" width="300" height="240"> | |
79 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/test/direction_4.png" alt="polar chart" width="250" height="250"> | |
80 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/test/pie_4.png" alt="pie chart" width="250" height="225"> | |
81 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/test/mountain_2-1.png" alt="mountain chart" width="300" height="225"> | |
82 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/test/split_2.png" alt="split chart" width="250" height="250"> | |
83 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/test/error_1.png" alt="error bar chart" width="300" height="225"> | |
74 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/landing/points.png" alt="point chart" width="300" height="225"> | |
75 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/landing/composite.png" alt="composite of bars and lines" width="300" height="225"> | |
76 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/landing/sbars.png" alt="stacked bars" width="300" height="200"> | |
77 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/landing/bars.png" alt="multi bar chart" width="300" height="250"> | |
78 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/landing/hbars.png" alt="horizontal bar chart" width="300" height="240"> | |
79 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/landing/polar.png" alt="polar chart" width="250" height="250"> | |
80 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/landing/ring.png" alt="pie chart" width="250" height="225"> | |
81 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/landing/mountain.png" alt="mountain chart" width="300" height="225"> | |
82 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/landing/split.png" alt="split chart" width="250" height="250"> | |
83 | <img src="https://raw.githubusercontent.com/lichtkind/Chart/main/dev/example/landing/error.png" alt="error bar chart" width="300" height="225"> | |
84 | 84 | </p> |
85 | 85 | |
86 | 86 | =head2 use-ing Chart |
96 | 96 | use Chart::Lines; |
97 | 97 | |
98 | 98 | would invoke the lines module. |
99 | Alternatively write to load all chart types at ones with | |
99 | Alternatively load all chart types at ones and write: | |
100 | 100 | |
101 | 101 | use Chart; |
102 | 102 | |
174 | 174 | |
175 | 175 | =back |
176 | 176 | |
177 | =head2 Graph.pm-style API | |
177 | =head2 column based API | |
178 | 178 | |
179 | 179 | You might ask, "But what if I just want to add a few points to the graph, |
180 | 180 | and then display it, without all those references to references?". Well, |