summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgregor herrmann <gregoa@debian.org>2022-04-05 17:38:47 +0200
committergregor herrmann <gregoa@debian.org>2022-04-05 17:38:47 +0200
commit28c1e3b461463116dbb2146d97dae9656498ad1f (patch)
tree590242ed34069116573e131f3d5d2393efe27283
parent03e9fa13a261afc82285e7461d3c5f250337043f (diff)
New upstream version 2.401.1+ds
-rw-r--r--Changes165
-rw-r--r--LICENSE225
-rw-r--r--MANIFEST149
-rw-r--r--META.json53
-rw-r--r--META.yml54
-rw-r--r--Makefile.PL53
-rw-r--r--README682
-rw-r--r--Readme.md12
-rw-r--r--[-rwxr-xr-x]TODO96
-rw-r--r--cpanfile17
-rw-r--r--dist.ini49
-rw-r--r--doc/LaTeX/Documentation.tex3
-rw-r--r--lib/Chart.pm116
-rw-r--r--lib/Chart/Bars.pm38
-rw-r--r--lib/Chart/Base.pm129
-rw-r--r--lib/Chart/BrushStyles.pm46
-rw-r--r--lib/Chart/Color.pm60
-rw-r--r--lib/Chart/Color/Named.pm502
-rw-r--r--lib/Chart/Color/Scheme.pm105
-rw-r--r--lib/Chart/Composite.pm24
-rw-r--r--lib/Chart/Constants.pm4
-rw-r--r--lib/Chart/Direction.pm23
-rw-r--r--lib/Chart/ErrorBars.pm34
-rw-r--r--lib/Chart/HorizontalBars.pm21
-rw-r--r--lib/Chart/Lines.pm27
-rw-r--r--lib/Chart/LinesPoints.pm23
-rw-r--r--lib/Chart/Mountain.pm32
-rw-r--r--lib/Chart/Pareto.pm18
-rw-r--r--lib/Chart/Pie.pm26
-rw-r--r--lib/Chart/Points.pm35
-rw-r--r--lib/Chart/Split.pm9
-rw-r--r--lib/Chart/StackedBars.pm21
-rw-r--r--t/Humidity.t6
-rw-r--r--t/Math_1_over_x.t6
-rw-r--r--t/bars.t4
-rw-r--r--t/bars_10.t4
-rw-r--r--t/bars_2.t4
-rw-r--r--t/bars_3.t4
-rw-r--r--t/bars_4.t4
-rw-r--r--t/bars_5.t4
-rw-r--r--t/bars_6.t4
-rw-r--r--t/bars_7.t4
-rw-r--r--t/bars_8.t4
-rw-r--r--t/bars_9.t4
-rw-r--r--t/composite.t4
-rw-r--r--t/composite_1.t4
-rw-r--r--t/composite_2.t4
-rw-r--r--t/composite_3.t4
-rw-r--r--t/composite_4.t6
-rw-r--r--t/composite_5.t4
-rw-r--r--t/composite_6.t4
-rw-r--r--t/composite_7.t4
-rw-r--r--t/composite_8.t4
-rw-r--r--t/composite_f.t4
-rw-r--r--t/direction_1.t4
-rw-r--r--t/direction_2.t4
-rw-r--r--t/direction_3.t4
-rw-r--r--t/direction_4.t4
-rw-r--r--t/error_1.t4
-rw-r--r--t/error_2.t6
-rw-r--r--t/f_ticks.t6
-rw-r--r--t/f_ticks_1.t4
-rw-r--r--t/hbars_1.t4
-rw-r--r--t/hbars_2.t4
-rw-r--r--t/hbars_3.t4
-rw-r--r--t/hbars_4.t6
-rw-r--r--t/lines.t4
-rw-r--r--t/lines_1.t4
-rw-r--r--t/lines_2.t4
-rw-r--r--t/lines_3.t4
-rw-r--r--t/lines_4.t4
-rw-r--r--t/lines_5.t4
-rw-r--r--t/lines_6.t4
-rw-r--r--t/lines_7.t4
-rw-r--r--t/lines_8.t4
-rw-r--r--t/lines_9.t6
-rw-r--r--t/linespoints.t4
-rw-r--r--t/linespoints_1.t4
-rw-r--r--t/linespoints_2.t4
-rw-r--r--t/linespoints_3.t4
-rw-r--r--t/linespoints_4.t4
-rw-r--r--t/linespoints_5.t4
-rw-r--r--t/linespoints_6.t4
-rw-r--r--t/linespoints_7.t4
-rw-r--r--t/mapbars.t5
-rw-r--r--t/mapcomp.t6
-rw-r--r--t/mountain.t4
-rw-r--r--t/mountain_2.t4
-rw-r--r--t/mountain_3.t4
-rw-r--r--t/mountain_4.t4
-rw-r--r--t/pareto_1.t4
-rw-r--r--t/pareto_2.t5
-rw-r--r--t/pareto_3.t4
-rw-r--r--t/pie_1.t4
-rw-r--r--t/pie_10.t4
-rw-r--r--t/pie_11.t4
-rw-r--r--t/pie_2.t4
-rw-r--r--t/pie_3.t4
-rw-r--r--t/pie_4.t4
-rw-r--r--t/pie_5.t4
-rw-r--r--t/pie_6.t4
-rw-r--r--t/pie_7.t4
-rw-r--r--t/pie_8.t4
-rw-r--r--t/pie_9.t4
-rw-r--r--t/points.t4
-rw-r--r--t/points_100.t4
-rw-r--r--t/points_2.t4
-rw-r--r--t/points_3.t4
-rw-r--r--t/points_4.t6
-rw-r--r--t/points_5.t6
-rw-r--r--t/scalarImage.t4
-rw-r--r--t/split_1.t4
-rw-r--r--t/split_2.t4
-rw-r--r--t/stackedbars.t4
-rw-r--r--t/stackedbars_2.t4
-rw-r--r--t/stackedbars_3.t4
-rw-r--r--t/stackedbars_4.t4
117 files changed, 2425 insertions, 788 deletions
diff --git a/Changes b/Changes
index 02709ae..f42c342 100644
--- a/Changes
+++ b/Changes
@@ -1,9 +1,18 @@
-2.400.10 2022-04-02
+
+2.401.1 2022-04-04
+ = minor fix release & test for init dzil file
+ ~ new file headers
+ ! 2 patches by Petr Pisar fixing tests
+ ? expanded TODO
+
+2.400.10 2022-04-02
= Testrelease for new metafiles
+ + cpan file
-2.400.5 2022-03-31
+2.400.5 2022-03-31
= Upload fix for failed 2.4.19 .. 2.400.04
- ? first upload by new maintainer: LICHTKIND
+ ~ first upload by new maintainer: LICHTKIND
+ + files CONTRIBUTING
2.4.10 Upload to pause.perl.org failed for version 2.4.9. Therefore, the version 2.4.9 was renamed to 2.4.10
for a new upload.
@@ -101,20 +110,20 @@
2.3 Changes done by Christine Zilker:
Added new Options:
- in Composite:
+ in Composite:
legend_example_height changes thickness of the lines in the legend,
- f_y_tick1, f_y_tick2 analog to f_y_tick
+ f_y_tick1, f_y_tick2 analog to f_y_tick
used for right and left y-axes
- in Direction:
+ in Direction:
pairs
Added the possibility to add more datasets in Chart::Direction
-
- Fixed "label space" problem in Pie
- Fixed dataset order (in the legend) in StackedBars
- Fixed problem of getting the right values if round2Tick is used
- Fixed problem of datavalues in _find_y_scale
- Some minor bugfixes
+
+ Fixed "label space" problem in Pie
+ Fixed dataset order (in the legend) in StackedBars
+ Fixed problem of getting the right values if round2Tick is used
+ Fixed problem of datavalues in _find_y_scale
+ Some minor bugfixes
Update of the Documentation (Documentation.pdf)
@@ -127,40 +136,40 @@
2.2: Composite.pm: imagemap_dump() repaired.
2.1: Changes done by Markus Brandl:
- new Modules added: ErrorBars.pm, HorizontalBars.pm, Pareto.pm,
-
- Pie.pm, Split.pm and Direction.pm
+ new Modules added: ErrorBars.pm, HorizontalBars.pm, Pareto.pm,
+
+ Pie.pm, Split.pm and Direction.pm
Subdirectory "doc" contains a Acrobat Reader Documentation.pdf file.
- Function add_datafile() added. It is now possible to add a complete
- datafile.
+ Function add_datafile() added. It is now possible to add a complete
+ datafile.
Added new Options: precision, xy_plot, min_x_ticks, max_x_ticks,
- skip_y_ticks, skip_int_ticks, legend_label_value, y_axes,
- scale, interval, start, interval_ticks, sort, same_error, point,
- line, arrow, angle_interval, min_circles, max_circles
- Also added: the 'title' and 'x_label' options in the colors option
+ skip_y_ticks, skip_int_ticks, legend_label_value, y_axes,
+ scale, interval, start, interval_ticks, sort, same_error, point,
+ line, arrow, angle_interval, min_circles, max_circles
+ Also added: the 'title' and 'x_label' options in the colors option
- Documentation (Documentation.pdf) added.
+ Documentation (Documentation.pdf) added.
- _find_x_scale, _find_x_range and _draw_x_number_ticks added to make
- xy_plots possible.
+ _find_x_scale, _find_x_range and _draw_x_number_ticks added to make
+ xy_plots possible.
- _sort_data has now a body.
+ _sort_data has now a body.
Fixed integer ticks problem by adding the skip_int_ticks option
- Fixed f_x_ticks and f_y_ticks problem in Composite
- Fixed negative value problem in Bars
- Fixed min_val and max_val problem in draw_data function of all modules:
- Now, Chart plots the data only if the data is in the area of min_val and
- max_val! The border of bars in Bars, HorizontalBars and StackedBars will
- be plotted pink (not misccolor) if the data isn't in the min_val-max_val
- interval.
- Fixed custom_x_ticks problem in _draw_x_ticks
- Some other bugfixes.
- Updates in _find_y_scale, _round2tick, _calcTickInterval
-
+ Fixed f_x_ticks and f_y_ticks problem in Composite
+ Fixed negative value problem in Bars
+ Fixed min_val and max_val problem in draw_data function of all modules:
+ Now, Chart plots the data only if the data is in the area of min_val and
+ max_val! The border of bars in Bars, HorizontalBars and StackedBars will
+ be plotted pink (not misccolor) if the data isn't in the min_val-max_val
+ interval.
+ Fixed custom_x_ticks problem in _draw_x_ticks
+ Some other bugfixes.
+ Updates in _find_y_scale, _round2tick, _calcTickInterval
+
1.1: Changes done by David Pottage:
Plot scales can now have any magnitude.
@@ -186,56 +195,56 @@
Delete GIF support, added PNG and JPEG instead
0.99b - 0.99c-pre3:
- James F Miner <jfm@winternet.com>:
- Added Mountain chart type
- Added Patterns. See t/mountain.t for details
- Bugfix for drifting x tick
- Improved internal color handling
+ James F Miner <jfm@winternet.com>:
+ Added Mountain chart type
+ Added Patterns. See t/mountain.t for details
+ Bugfix for drifting x tick
+ Improved internal color handling
- Richard Dice <rdice@shadnet.shad.ca>:
- Added brush shapes for Points, LinesPoints
- Added scalar_gif
+ Richard Dice <rdice@shadnet.shad.ca>:
+ Added brush shapes for Points, LinesPoints
+ Added scalar_gif
0.99a - 0.99b:
- Fixed left legend in composite charts
- Fixed no color problem when using composite charts w/ no legend
- Fixed color handling for datasets
- Added option for http header Pragma: no-cache
- Netscape 4.5 has a bug that breaks it, but it works with
- other browsers. Any ideas for a workaround?
+ Fixed left legend in composite charts
+ Fixed no color problem when using composite charts w/ no legend
+ Fixed color handling for datasets
+ Added option for http header Pragma: no-cache
+ Netscape 4.5 has a bug that breaks it, but it works with
+ other browsers. Any ideas for a workaround?
0.99 - 0.99a:
- Added use of undef() values to represent 'no data' for line breaks
- Added ylabel*_color options
- Added x_grid_lines, y_grid_lines & y2_grid_lines , and color options for each
- Cache disabling in cgi header: Reiner Nippes <nippes.r@gmx.de>
- Restored grid_lines option: Heinz-Guenter Kontny <hek@kronos.nic.dtag.de>
- Fixed a typo that broke imagemap data storage in Lines charts
+ Added use of undef() values to represent 'no data' for line breaks
+ Added ylabel*_color options
+ Added x_grid_lines, y_grid_lines & y2_grid_lines , and color options for each
+ Cache disabling in cgi header: Reiner Nippes <nippes.r@gmx.de>
+ Restored grid_lines option: Heinz-Guenter Kontny <hek@kronos.nic.dtag.de>
+ Fixed a typo that broke imagemap data storage in Lines charts
0.94 - 0.99:
- Modified the 'title' option to correctly process newlines
- Deprecated the 'subtitle' option, will remove it in next release
- Changed the API for specifying colors
- Added support for printing to file handles
- Added Chart::Composite
- Added 'spaced_bars' to make it easy to differentiate the bars
- Added 'grey_background' to make plot background grey
- Added support for negative values in the datasets
- Added methods to remember and dump imagemap pixel information
- Included rgb.txt with distribution for WinXX users
+ Modified the 'title' option to correctly process newlines
+ Deprecated the 'subtitle' option, will remove it in next release
+ Changed the API for specifying colors
+ Added support for printing to file handles
+ Added Chart::Composite
+ Added 'spaced_bars' to make it easy to differentiate the bars
+ Added 'grey_background' to make plot background grey
+ Added support for negative values in the datasets
+ Added methods to remember and dump imagemap pixel information
+ Included rgb.txt with distribution for WinXX users
0.93 - 0.94:
- Moved the legend down to be flush with the chart
- Fixed the long decimal y-tick label problem
- Fixed (for the last time, hopefully) the pre-5.004 compilation problem
- Fixed handling of undefined data points
- Added more colors for the default data colors
- Added the transparent gif option
- Added the option for user-specified colors
- Added the grid_lines option
+ Moved the legend down to be flush with the chart
+ Fixed the long decimal y-tick label problem
+ Fixed (for the last time, hopefully) the pre-5.004 compilation problem
+ Fixed handling of undefined data points
+ Added more colors for the default data colors
+ Added the transparent gif option
+ Added the option for user-specified colors
+ Added the grid_lines option
0.92 - 0.93:
- Fixed the sort problem
- Fixed the y-axis label centering problem
- Fixed pre-5.004 compilation problem
- Added StackedBars charts
+ Fixed the sort problem
+ Fixed the y-axis label centering problem
+ Fixed pre-5.004 compilation problem
+ Added StackedBars charts
diff --git a/LICENSE b/LICENSE
index ffca941..d5fe75f 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,76 +1,207 @@
-This software is copyright (c) 1997-2022 by Chart-Group (CHARTGRP).
+This software is Copyright (c) 1997-2022 by Chart-Group <chartgrp@web.de>.
-Copyright of the following text: (c) 2000-2006, The Perl Foundation.
+This is free software, licensed under:
-----------------------------------------------------------------------------------------------------
+ The Artistic License 2.0 (GPL Compatible)
-Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
-Preamble
-
-This license establishes the terms under which a given free software Package may be copied, modified, distributed, and/or redistributed. The intent is that the Copyright Holder maintains some artistic control over the development of that Package while still keeping the Package available as open source and free software.
-
-You are always permitted to make arrangements wholly outside of this license directly with the Copyright Holder of a given Package. If the terms of this license do not permit the full use that you propose to make of the Package, you should contact the Copyright Holder and seek a different licensing arrangement.
-Definitions
+ The Artistic License 2.0
-"Copyright Holder" means the individual(s) or organization(s) named in the copyright notice for the entire Package.
+ Copyright (c) 2000-2006, The Perl Foundation.
-"Contributor" means any party that has contributed code or other material to the Package, in accordance with the Copyright Holder's procedures.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
-"You" and "your" means any person who would like to copy, distribute, or modify the Package.
+Preamble
-"Package" means the collection of files distributed by the Copyright Holder, and derivatives of that collection and/or of those files. A given Package may consist of either the Standard Version, or a Modified Version.
+This license establishes the terms under which a given free software
+Package may be copied, modified, distributed, and/or redistributed.
+The intent is that the Copyright Holder maintains some artistic
+control over the development of that Package while still keeping the
+Package available as open source and free software.
-"Distribute" means providing a copy of the Package or making it accessible to anyone else, or in the case of a company or organization, to others outside of your company or organization.
+You are always permitted to make arrangements wholly outside of this
+license directly with the Copyright Holder of a given Package. If the
+terms of this license do not permit the full use that you propose to
+make of the Package, you should contact the Copyright Holder and seek
+a different licensing arrangement.
-"Distributor Fee" means any fee that you charge for Distributing this Package or providing support for this Package to another party. It does not mean licensing fees.
+Definitions
-"Standard Version" refers to the Package if it has not been modified, or has been modified only in ways explicitly requested by the Copyright Holder.
+ "Copyright Holder" means the individual(s) or organization(s)
+ named in the copyright notice for the entire Package.
-"Modified Version" means the Package, if it has been changed, and such changes were not explicitly requested by the Copyright Holder.
+ "Contributor" means any party that has contributed code or other
+ material to the Package, in accordance with the Copyright Holder's
+ procedures.
-"Original License" means this Artistic License as Distributed with the Standard Version of the Package, in its current version or as it may be modified by The Perl Foundation in the future.
+ "You" and "your" means any person who would like to copy,
+ distribute, or modify the Package.
-"Source" form means the source code, documentation source, and configuration files for the Package.
+ "Package" means the collection of files distributed by the
+ Copyright Holder, and derivatives of that collection and/or of
+ those files. A given Package may consist of either the Standard
+ Version, or a Modified Version.
-"Compiled" form means the compiled bytecode, object code, binary, or any other form resulting from mechanical transformation or translation of the Source form.
-Permission for Use and Modification Without Distribution
+ "Distribute" means providing a copy of the Package or making it
+ accessible to anyone else, or in the case of a company or
+ organization, to others outside of your company or organization.
-(1) You are permitted to use the Standard Version and create and use Modified Versions for any purpose without restriction, provided that you do not Distribute the Modified Version.
-Permissions for Redistribution of the Standard Version
+ "Distributor Fee" means any fee that you charge for Distributing
+ this Package or providing support for this Package to another
+ party. It does not mean licensing fees.
-(2) You may Distribute verbatim copies of the Source form of the Standard Version of this Package in any medium without restriction, either gratis or for a Distributor Fee, provided that you duplicate all of the original copyright notices and associated disclaimers. At your discretion, such verbatim copies may or may not include a Compiled form of the Package.
+ "Standard Version" refers to the Package if it has not been
+ modified, or has been modified only in ways explicitly requested
+ by the Copyright Holder.
-(3) You may apply any bug fixes, portability changes, and other modifications made available from the Copyright Holder. The resulting Package will still be considered the Standard Version, and as such will be subject to the Original License.
-Distribution of Modified Versions of the Package as Source
+ "Modified Version" means the Package, if it has been changed, and
+ such changes were not explicitly requested by the Copyright
+ Holder.
-(4) You may Distribute your Modified Version as Source (either gratis or for a Distributor Fee, and with or without a Compiled form of the Modified Version) provided that you clearly document how it differs from the Standard Version, including, but not limited to, documenting any non-standard features, executables, or modules, and provided that you do at least ONE of the following:
+ "Original License" means this Artistic License as Distributed with
+ the Standard Version of the Package, in its current version or as
+ it may be modified by The Perl Foundation in the future.
-(a) make the Modified Version available to the Copyright Holder of the Standard Version, under the Original License, so that the Copyright Holder may include your modifications in the Standard Version.
-(b) ensure that installation of your Modified Version does not prevent the user installing or running the Standard Version. In addition, the Modified Version must bear a name that is different from the name of the Standard Version.
-(c) allow anyone who receives a copy of the Modified Version to make the Source form of the Modified Version available to others under
-(i) the Original License or
-(ii) a license that permits the licensee to freely copy, modify and redistribute the Modified Version using the same licensing terms that apply to the copy that the licensee received, and requires that the Source form of the Modified Version, and of any works derived from it, be made freely available in that license fees are prohibited but Distributor Fees are allowed.
-Distribution of Compiled Forms of the Standard Version or Modified Versions without the Source
+ "Source" form means the source code, documentation source, and
+ configuration files for the Package.
-(5) You may Distribute Compiled forms of the Standard Version without the Source, provided that you include complete instructions on how to get the Source of the Standard Version. Such instructions must be valid at the time of your distribution. If these instructions, at any time while you are carrying out such distribution, become invalid, you must provide new instructions on demand or cease further distribution. If you provide valid instructions or cease distribution within thirty days after you become aware that the instructions are invalid, then you do not forfeit any of your rights under this license.
+ "Compiled" form means the compiled bytecode, object code, binary,
+ or any other form resulting from mechanical transformation or
+ translation of the Source form.
-(6) You may Distribute a Modified Version in Compiled form without the Source, provided that you comply with Section 4 with respect to the Source of the Modified Version.
-Aggregating or Linking the Package
-(7) You may aggregate the Package (either the Standard Version or Modified Version) with other packages and Distribute the resulting aggregation provided that you do not charge a licensing fee for the Package. Distributor Fees are permitted, and licensing fees for other components in the aggregation are permitted. The terms of this license apply to the use and Distribution of the Standard or Modified Versions as included in the aggregation.
+Permission for Use and Modification Without Distribution
-(8) You are permitted to link Modified and Standard Versions with other works, to embed the Package in a larger work of your own, or to build stand-alone binary or bytecode versions of applications that include the Package, and Distribute the result without restriction, provided the result does not expose a direct interface to the Package.
-Items That are Not Considered Part of a Modified Version
+(1) You are permitted to use the Standard Version and create and use
+Modified Versions for any purpose without restriction, provided that
+you do not Distribute the Modified Version.
-(9) Works (including, but not limited to, modules and scripts) that merely extend or make use of the Package, do not, by themselves, cause the Package to be a Modified Version. In addition, such works are not considered parts of the Package itself, and are not subject to the terms of this license.
-General Provisions
-(10) Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license.
+Permissions for Redistribution of the Standard Version
-(11) If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license.
+(2) You may Distribute verbatim copies of the Source form of the
+Standard Version of this Package in any medium without restriction,
+either gratis or for a Distributor Fee, provided that you duplicate
+all of the original copyright notices and associated disclaimers. At
+your discretion, such verbatim copies may or may not include a
+Compiled form of the Package.
+
+(3) You may apply any bug fixes, portability changes, and other
+modifications made available from the Copyright Holder. The resulting
+Package will still be considered the Standard Version, and as such
+will be subject to the Original License.
+
+
+Distribution of Modified Versions of the Package as Source
+
+(4) You may Distribute your Modified Version as Source (either gratis
+or for a Distributor Fee, and with or without a Compiled form of the
+Modified Version) provided that you clearly document how it differs
+from the Standard Version, including, but not limited to, documenting
+any non-standard features, executables, or modules, and provided that
+you do at least ONE of the following:
+
+ (a) make the Modified Version available to the Copyright Holder
+ of the Standard Version, under the Original License, so that the
+ Copyright Holder may include your modifications in the Standard
+ Version.
+
+ (b) ensure that installation of your Modified Version does not
+ prevent the user installing or running the Standard Version. In
+ addition, the Modified Version must bear a name that is different
+ from the name of the Standard Version.
+
+ (c) allow anyone who receives a copy of the Modified Version to
+ make the Source form of the Modified Version available to others
+ under
+
+ (i) the Original License or
+
+ (ii) a license that permits the licensee to freely copy,
+ modify and redistribute the Modified Version using the same
+ licensing terms that apply to the copy that the licensee
+ received, and requires that the Source form of the Modified
+ Version, and of any works derived from it, be made freely
+ available in that license fees are prohibited but Distributor
+ Fees are allowed.
+
+
+Distribution of Compiled Forms of the Standard Version
+or Modified Versions without the Source
+
+(5) You may Distribute Compiled forms of the Standard Version without
+the Source, provided that you include complete instructions on how to
+get the Source of the Standard Version. Such instructions must be
+valid at the time of your distribution. If these instructions, at any
+time while you are carrying out such distribution, become invalid, you
+must provide new instructions on demand or cease further distribution.
+If you provide valid instructions or cease distribution within thirty
+days after you become aware that the instructions are invalid, then
+you do not forfeit any of your rights under this license.
+
+(6) You may Distribute a Modified Version in Compiled form without
+the Source, provided that you comply with Section 4 with respect to
+the Source of the Modified Version.
+
+
+Aggregating or Linking the Package
+
+(7) You may aggregate the Package (either the Standard Version or
+Modified Version) with other packages and Distribute the resulting
+aggregation provided that you do not charge a licensing fee for the
+Package. Distributor Fees are permitted, and licensing fees for other
+components in the aggregation are permitted. The terms of this license
+apply to the use and Distribution of the Standard or Modified Versions
+as included in the aggregation.
+
+(8) You are permitted to link Modified and Standard Versions with
+other works, to embed the Package in a larger work of your own, or to
+build stand-alone binary or bytecode versions of applications that
+include the Package, and Distribute the result without restriction,
+provided the result does not expose a direct interface to the Package.
+
+
+Items That are Not Considered Part of a Modified Version
+
+(9) Works (including, but not limited to, modules and scripts) that
+merely extend or make use of the Package, do not, by themselves, cause
+the Package to be a Modified Version. In addition, such works are not
+considered parts of the Package itself, and are not subject to the
+terms of this license.
-(12) This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder.
-(13) This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed.
+General Provisions
-(14) Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+(10) Any use, modification, and distribution of the Standard or
+Modified Versions is governed by this Artistic License. By using,
+modifying or distributing the Package, you accept this license. Do not
+use, modify, or distribute the Package, if you do not accept this
+license.
+
+(11) If your Modified Version has been derived from a Modified
+Version made by someone other than you, you are nevertheless required
+to ensure that your Modified Version complies with the requirements of
+this license.
+
+(12) This license does not grant you the right to use any trademark,
+service mark, tradename, or logo of the Copyright Holder.
+
+(13) This license includes the non-exclusive, worldwide,
+free-of-charge patent license to make, have made, use, offer to sell,
+sell, import and otherwise transfer the Package with respect to any
+patent claims licensable by the Copyright Holder that are necessarily
+infringed by the Package. If you institute patent litigation
+(including a cross-claim or counterclaim) against any party alleging
+that the Package constitutes direct or contributory patent
+infringement, then this Artistic License to you shall terminate on the
+date that such litigation is filed.
+
+(14) Disclaimer of Warranty:
+THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
+IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
+NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL
+LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/MANIFEST b/MANIFEST
index 30d3726..ad55af1 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,13 +1,75 @@
-Changes
+# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.024.
CONTRIBUTING
+Changes
+Documentation.pdf
+LICENSE
+MANIFEST
+META.json
+META.yml
+Makefile.PL
+README
+Readme.md
+TODO
cpanfile
-doc/html/annotated.html
-doc/html/annotated.js
+dist.ini
+doc/LaTeX/Appendix.tex
+doc/LaTeX/AppendixRGB.tex
+doc/LaTeX/Aufbau.png
+doc/LaTeX/Bars.tex
+doc/LaTeX/Base.tex
+doc/LaTeX/Composite.tex
+doc/LaTeX/Direction.tex
+doc/LaTeX/Documentation.pdf
+doc/LaTeX/Documentation.tex
+doc/LaTeX/Elemente.png
+doc/LaTeX/ErrorBars.tex
+doc/LaTeX/HorizontalBars.tex
+doc/LaTeX/Lines.tex
+doc/LaTeX/LinesPoints.tex
+doc/LaTeX/Mountain.tex
+doc/LaTeX/Pareto.tex
+doc/LaTeX/Pie.tex
+doc/LaTeX/Points.tex
+doc/LaTeX/Split.tex
+doc/LaTeX/Stacked.tex
+doc/LaTeX/brushstyles.png
+doc/LaTeX/composite.png
+doc/LaTeX/d_bars.png
+doc/LaTeX/d_hbars4.png
+doc/LaTeX/d_lines2.png
+doc/LaTeX/d_linesp2.png
+doc/LaTeX/d_pareto2.png
+doc/LaTeX/d_pie3.png
+doc/LaTeX/definitions.tex
+doc/LaTeX/description.tex
+doc/LaTeX/direction.png
+doc/LaTeX/error.png
+doc/LaTeX/mountain.png
+doc/LaTeX/points.png
+doc/LaTeX/rgb.dat
+doc/LaTeX/rgb.tex
+doc/LaTeX/stackedbars.png
+doc/LaTeX/stunde.png
doc/html/Bars_8pm.html
doc/html/Base_8pm.html
+doc/html/BrushStyles_8pm.html
+doc/html/Composite_8pm.html
+doc/html/Constants_8pm.html
+doc/html/Direction_8pm.html
+doc/html/ErrorBars_8pm.html
+doc/html/HorizontalBars_8pm.html
+doc/html/LinesPoints_8pm.html
+doc/html/Lines_8pm.html
+doc/html/Mountain_8pm.html
+doc/html/Pareto_8pm.html
+doc/html/Pie_8pm.html
+doc/html/Points_8pm.html
+doc/html/Split_8pm.html
+doc/html/StackedBars_8pm.html
+doc/html/annotated.html
+doc/html/annotated.js
doc/html/bc_s.png
doc/html/bdwn.png
-doc/html/BrushStyles_8pm.html
doc/html/classChart_1_1Bars-members.html
doc/html/classChart_1_1Bars.html
doc/html/classChart_1_1Bars.js
@@ -75,12 +137,6 @@ doc/html/classChart_1_1HorizontalBars__inherit__graph.png
doc/html/classChart_1_1Lines-members.html
doc/html/classChart_1_1Lines.html
doc/html/classChart_1_1Lines.js
-doc/html/classChart_1_1Lines__coll__graph.map
-doc/html/classChart_1_1Lines__coll__graph.md5
-doc/html/classChart_1_1Lines__coll__graph.png
-doc/html/classChart_1_1Lines__inherit__graph.map
-doc/html/classChart_1_1Lines__inherit__graph.md5
-doc/html/classChart_1_1Lines__inherit__graph.png
doc/html/classChart_1_1LinesPoints-members.html
doc/html/classChart_1_1LinesPoints.html
doc/html/classChart_1_1LinesPoints.js
@@ -90,6 +146,12 @@ doc/html/classChart_1_1LinesPoints__coll__graph.png
doc/html/classChart_1_1LinesPoints__inherit__graph.map
doc/html/classChart_1_1LinesPoints__inherit__graph.md5
doc/html/classChart_1_1LinesPoints__inherit__graph.png
+doc/html/classChart_1_1Lines__coll__graph.map
+doc/html/classChart_1_1Lines__coll__graph.md5
+doc/html/classChart_1_1Lines__coll__graph.png
+doc/html/classChart_1_1Lines__inherit__graph.map
+doc/html/classChart_1_1Lines__inherit__graph.md5
+doc/html/classChart_1_1Lines__inherit__graph.png
doc/html/classChart_1_1Mountain-members.html
doc/html/classChart_1_1Mountain.html
doc/html/classChart_1_1Mountain.js
@@ -146,18 +208,14 @@ doc/html/classChart_1_1StackedBars__inherit__graph.md5
doc/html/classChart_1_1StackedBars__inherit__graph.png
doc/html/classes.html
doc/html/closed.png
-doc/html/Composite_8pm.html
-doc/html/Constants_8pm.html
doc/html/dir_4c1e16b25926905315b25af094fe9aa3.html
doc/html/dir_4c1e16b25926905315b25af094fe9aa3.js
doc/html/dir_4c1e16b25926905315b25af094fe9aa3_dep.map
doc/html/dir_4c1e16b25926905315b25af094fe9aa3_dep.md5
doc/html/dir_4c1e16b25926905315b25af094fe9aa3_dep.png
-doc/html/Direction_8pm.html
doc/html/doxygen.css
doc/html/doxygen.png
doc/html/dynsections.js
-doc/html/ErrorBars_8pm.html
doc/html/files.html
doc/html/files.js
doc/html/ftv2blank.png
@@ -184,7 +242,6 @@ doc/html/graph_legend.md5
doc/html/graph_legend.png
doc/html/hierarchy.html
doc/html/hierarchy.js
-doc/html/HorizontalBars_8pm.html
doc/html/index.html
doc/html/inherit__graph__0.map
doc/html/inherit__graph__0.md5
@@ -203,10 +260,7 @@ doc/html/inherit_graph_1.md5
doc/html/inherit_graph_1.png
doc/html/inherits.html
doc/html/jquery.js
-doc/html/Lines_8pm.html
-doc/html/LinesPoints_8pm.html
doc/html/main.html
-doc/html/Mountain_8pm.html
doc/html/nav_f.png
doc/html/nav_g.png
doc/html/nav_h.png
@@ -215,12 +269,7 @@ doc/html/navtree.js
doc/html/navtreeindex0.js
doc/html/open.png
doc/html/pages.html
-doc/html/Pareto_8pm.html
-doc/html/Pie_8pm.html
-doc/html/Points_8pm.html
doc/html/resize.js
-doc/html/Split_8pm.html
-doc/html/StackedBars_8pm.html
doc/html/sync_off.png
doc/html/sync_on.png
doc/html/tab_a.png
@@ -233,50 +282,13 @@ doc/html/tab_s.png
doc/html/tabs.css
doc/html/todo.html
doc/html/tree.html
-doc/LaTeX/Appendix.tex
-doc/LaTeX/AppendixRGB.tex
-doc/LaTeX/Aufbau.png
-doc/LaTeX/Bars.tex
-doc/LaTeX/Base.tex
-doc/LaTeX/brushstyles.png
-doc/LaTeX/composite.png
-doc/LaTeX/Composite.tex
-doc/LaTeX/d_bars.png
-doc/LaTeX/d_hbars4.png
-doc/LaTeX/d_lines2.png
-doc/LaTeX/d_linesp2.png
-doc/LaTeX/d_pareto2.png
-doc/LaTeX/d_pie3.png
-doc/LaTeX/definitions.tex
-doc/LaTeX/description.tex
-doc/LaTeX/direction.png
-doc/LaTeX/Direction.tex
-doc/LaTeX/Documentation.pdf
-doc/LaTeX/Documentation.tex
-doc/LaTeX/Elemente.png
-doc/LaTeX/error.png
-doc/LaTeX/ErrorBars.tex
-doc/LaTeX/HorizontalBars.tex
-doc/LaTeX/Lines.tex
-doc/LaTeX/LinesPoints.tex
-doc/LaTeX/mountain.png
-doc/LaTeX/Mountain.tex
-doc/LaTeX/Pareto.tex
-doc/LaTeX/Pie.tex
-doc/LaTeX/points.png
-doc/LaTeX/Points.tex
-doc/LaTeX/rgb.dat
-doc/LaTeX/rgb.tex
-doc/LaTeX/Split.tex
-doc/LaTeX/Stacked.tex
-doc/LaTeX/stackedbars.png
-doc/LaTeX/stunde.png
-Documentation.pdf
-LICENCE
lib/Chart.pm
lib/Chart/Bars.pm
lib/Chart/Base.pm
lib/Chart/BrushStyles.pm
+lib/Chart/Color.pm
+lib/Chart/Color/Named.pm
+lib/Chart/Color/Scheme.pm
lib/Chart/Composite.pm
lib/Chart/Constants.pm
lib/Chart/Direction.pm
@@ -290,10 +302,6 @@ lib/Chart/Pie.pm
lib/Chart/Points.pm
lib/Chart/Split.pm
lib/Chart/StackedBars.pm
-Makefile.PL
-MANIFEST
-META.yml
-MYMETA.yml
patterns/PATTERN0.GIF
patterns/PATTERN0.PNG
patterns/PATTERN1.GIF
@@ -306,8 +314,8 @@ patterns/PATTERN4.GIF
patterns/PATTERN4.PNG
patterns/PATTERN5.GIF
patterns/PATTERN5.PNG
-pm_to_blib
-Readme.md
+t/Humidity.t
+t/Math_1_over_x.t
t/bars.t
t/bars_10.t
t/bars_2.t
@@ -340,7 +348,6 @@ t/hbars_1.t
t/hbars_2.t
t/hbars_3.t
t/hbars_4.t
-t/Humidity.t
t/lines.t
t/lines_1.t
t/lines_2.t
@@ -361,7 +368,6 @@ t/linespoints_6.t
t/linespoints_7.t
t/mapbars.t
t/mapcomp.t
-t/Math_1_over_x.t
t/mountain.t
t/mountain_2.t
t/mountain_3.t
@@ -393,4 +399,3 @@ t/stackedbars.t
t/stackedbars_2.t
t/stackedbars_3.t
t/stackedbars_4.t
-TODO
diff --git a/META.json b/META.json
new file mode 100644
index 0000000..39e1285
--- /dev/null
+++ b/META.json
@@ -0,0 +1,53 @@
+{
+ "abstract" : "a series of charting modules ",
+ "author" : [
+ "Chart-Group <chartgrp@web.de>"
+ ],
+ "dynamic_config" : 0,
+ "generated_by" : "Dist::Zilla version 6.024, CPAN::Meta::Converter version 2.150010",
+ "license" : [
+ "artistic_2"
+ ],
+ "meta-spec" : {
+ "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
+ "version" : "2"
+ },
+ "name" : "Chart",
+ "no_index" : {
+ "directory" : [
+ "patterns",
+ "t"
+ ],
+ "package" : [
+ "Chart::Base"
+ ]
+ },
+ "prereqs" : {
+ "configure" : {
+ "requires" : {
+ "ExtUtils::MakeMaker" : "0"
+ }
+ },
+ "runtime" : {
+ "requires" : {
+ "Carp" : "1.35",
+ "GD" : "2",
+ "perl" : "v5.12.0"
+ }
+ },
+ "test" : {
+ "requires" : {
+ "File::Temp" : "0.19"
+ }
+ }
+ },
+ "release_status" : "stable",
+ "version" : "v2.401.1",
+ "x_generated_by_perl" : "v5.26.1",
+ "x_maintainers" : [
+ "Herbert Breunung <lichtkind@cpan.org>"
+ ],
+ "x_serialization_backend" : "JSON::XS version 3.04",
+ "x_spdx_expression" : "Artistic-2.0"
+}
+
diff --git a/META.yml b/META.yml
index 4757464..34acddf 100644
--- a/META.yml
+++ b/META.yml
@@ -1,31 +1,31 @@
---- #YAML:1.0
-name: Chart
-version: 2.400.10
-abstract: a series of charting modules
+---
+abstract: 'a series of charting modules '
author:
- 'Chart-Group <chartgrp@web.de>'
- - 'Herbert Breunung <lichtkind@cpan.org>'
-license: artistic_2
-distribution_type: module
-configure_requires:
- ExtUtils::MakeMaker: 0
build_requires:
- ExtUtils::MakeMaker: 0
-provides:
- Chart:
- file: lib/Chart.pm
- version: 2.400.10
-requires:
- perl: '5.012000'
- GD: 2
- Carp: 1.35
-no_index:
- directory:
- - t
- - inc
- - doc
- - patterns
-generated_by: ExtUtils::MakeMaker version 6.57_05
+ File::Temp: '0.19'
+configure_requires:
+ ExtUtils::MakeMaker: '0'
+dynamic_config: 0
+generated_by: 'Dist::Zilla version 6.024, CPAN::Meta::Converter version 2.150010'
+license: artistic_2
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: '1.4'
+name: Chart
+no_index:
+ directory:
+ - patterns
+ - t
+ package:
+ - Chart::Base
+requires:
+ Carp: '1.35'
+ GD: '2'
+ perl: v5.12.0
+version: v2.401.1
+x_generated_by_perl: v5.26.1
+x_maintainers:
+ - 'Herbert Breunung <lichtkind@cpan.org>'
+x_serialization_backend: 'YAML::Tiny version 1.70'
+x_spdx_expression: Artistic-2.0
diff --git a/Makefile.PL b/Makefile.PL
index d6c370b..564723c 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,10 +1,49 @@
+# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.024.
+use strict;
+use warnings;
+
+use 5.012000;
+
use ExtUtils::MakeMaker;
-# make the samples directory
-mkdir ('samples', 00755);
+my %WriteMakefileArgs = (
+ "ABSTRACT" => "a series of charting modules ",
+ "AUTHOR" => "Chart-Group <chartgrp\@web.de>",
+ "CONFIGURE_REQUIRES" => {
+ "ExtUtils::MakeMaker" => 0
+ },
+ "DISTNAME" => "Chart",
+ "LICENSE" => "artistic_2",
+ "MIN_PERL_VERSION" => "5.012000",
+ "NAME" => "Chart",
+ "PREREQ_PM" => {
+ "Carp" => "1.35",
+ "GD" => 2
+ },
+ "TEST_REQUIRES" => {
+ "File::Temp" => "0.19"
+ },
+ "VERSION" => "v2.401.1",
+ "test" => {
+ "TESTS" => "t/*.t"
+ }
+);
+
+
+my %FallbackPrereqs = (
+ "Carp" => "1.35",
+ "File::Temp" => "0.19",
+ "GD" => 2
+);
+
+
+unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
+ delete $WriteMakefileArgs{TEST_REQUIRES};
+ delete $WriteMakefileArgs{BUILD_REQUIRES};
+ $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
+}
+
+delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
+ unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
-# write the makefile
-WriteMakefile ( 'NAME' => 'Chart',
- 'PREREQ_PM' => { 'GD' => 2.0 },
- 'dist' => { 'COMPRESS' => 'gzip', 'SUFFIX' => 'gz' },
- 'VERSION' => '2.400.10' )
+WriteMakefile(%WriteMakefileArgs);
diff --git a/README b/README
new file mode 100644
index 0000000..81d88c7
--- /dev/null
+++ b/README
@@ -0,0 +1,682 @@
+NAME
+ Chart - a series of charting modules
+
+SYNOPSIS
+ use Chart::type; (type is one of: Points, Lines, Bars, LinesPoints, Composite,
+ StackedBars, Mountain, Pie, HorizontalBars, Split, ErrorBars, Pareto, Direction)
+
+ $obj = Chart::type->new;
+ $obj = Chart::type->new ( $png_width, $png_height );
+
+ $obj->set ( $key_1, $val_1, ... ,$key_n, $val_n );
+ $obj->set ( $key_1 => $val_1,
+ ...
+ $key_n => $val_n );
+ $obj->set ( %hash );
+
+ # GIFgraph.pm-style API to produce png formatted charts
+ @data = ( \@x_tick_labels, \@dataset1, ... , \@dataset_n );
+ $obj->png ( "filename", \@data );
+ $obj->png ( $filehandle, \@data );
+ $obj->png ( FILEHANDLE, \@data );
+ $obj->cgi_png ( \@data );
+
+ # Graph.pm-style API
+ $obj->add_pt ($label, $val_1, ... , $val_n);
+ $obj->add_dataset ($val_1, ... , $val_n);
+ $obj->png ( "filename" );
+ $obj->png ( $filehandle );
+ $obj->png ( FILEHANDLE );
+ $obj->cgi_png ();
+
+ The similar functions are available for j-peg
+
+ # Retrieve image map information
+ $obj->set ( 'imagemap' => 'true' );
+ $imagemap_ref = $obj->imagemap_dump ();
+
+DESCRIPTION
+ These man-pages give you the most important information about Chart.
+ There is also a complete documentation (Documentation.pdf) within the
+ Chart package. Look at it to get more information. This module is an
+ attempt to build a general purpose graphing module that is easily
+ modified and expanded. I borrowed most of the API from Martien
+ Verbruggen's GIFgraph module. I liked most of GIFgraph, but I thought it
+ was to difficult to modify, and it was missing a few things that I
+ needed, most notably legends. So I decided to write a new module from
+ scratch, and I've designed it from the bottom up to be easy to modify.
+ Like GIFgraph, Chart uses Lincoln Stein's GD module for all of its
+ graphics primitives calls.
+
+ use-ing Chart
+ Okay, so you caught me. There's really no Chart::type module. All of the
+ different chart types (Points, Lines, Bars, LinesPoints, Composite,
+ StackedBars, Pie, Pareto, HorizontalBars, Split, ErrorBars, Direction
+ and Mountain so far) are classes by themselves, each inheriting a bunch
+ of methods from the Chart::Base class. Simply replace the word type with
+ the type of chart you want and you're on your way. For example,
+
+ use Chart::Lines;
+
+ would invoke the lines module.
+
+ Getting an object
+ The new method can either be called without arguments, in which case it
+ returns an object with the default image size (400x300 pixels), or you
+ can specify the width and height of the image. Just remember to replace
+ type with the type of graph you want. For example,
+
+ $obj = Chart::Bars->new (600,400);
+
+ would return a Chart::Bars object containing a 600x400 pixel image. New
+ also initializes most of the default variables, which you can
+ subsequently change with the set method.
+
+ Setting different options
+ This is where the fun begins. Set looks for a hash of keys and values.
+ You can pass it a hash that you've already constructed, like
+
+ %hash = ('title' => 'Foo Bar');
+ $obj->set (%hash);
+
+ or you can try just constructing the hash inside the set call, like
+
+ $obj->set ('title' => 'Foo Bar');
+
+ The following are all of the currently supported options:
+
+ 'transparent'
+ Makes the background of the image transparent if set to 'true'.
+ Useful for making web page images. Default is 'false'.
+
+ 'png_border'
+ Sets the number of pixels used as a border between the graph and the
+ edges of the png/j-peg. Defaults to 10.
+
+ 'graph_border'
+ Sets the number of pixels used as a border between the title/labels
+ and the actual graph within the png. Defaults to 10.
+
+ 'text_space'
+ Sets the amount of space left on the sides of text, to make it more
+ readable. Defaults to 2.
+
+ 'title'
+ Tells GD graph what to use for the title of the graph. If empty, no
+ title is drawn. It recognizes '\n' as a newline, and acts
+ accordingly. Remember, if you want to use normal quotation marks
+ instead of single quotation marks then you have to quote "\\n".
+ Default is empty.
+
+ 'sub_title'
+ Write a sub-title under the title in smaller letters.
+
+ 'x_label'
+ Tells Chart what to use for the x-axis label. If empty, no label is
+ drawn. Default is empty.
+
+ 'y_label', 'y_label2'
+ Tells Chart what to use for the y-axis labels. If empty, no label is
+ drawn. Default is empty.
+
+ 'legend'
+ Specifies the placement of the legend. Valid values are 'left',
+ 'right', 'top', 'bottom'. Setting this to 'none' tells chart not to
+ draw a legend. Default is 'right'.
+
+ 'legend_labels'
+ Sets the values for the labels for the different data sets. Should
+ be assigned a reference to an array of labels. For example,
+
+ @labels = ('foo', 'bar');
+ $obj->set ('legend_labels' => \@labels);
+
+ Default is empty, in which case 'Dataset 1', 'Dataset 2', etc. are
+ used as the labels.
+
+ 'tick_len'
+ Sets the length of the x- and y-ticks in pixels. Default is 4.
+
+ 'x_ticks'
+ Specifies how to draw the x-tick labels. Valid values are 'normal',
+ 'staggered' (staggers the labels vertically), and 'vertical' (the
+ labels are draw upwards). Default is 'normal'.
+
+ 'xy_plot'
+ Forces Chart to plot a x-y-graph, which means, that the x-axis is
+ also numeric if set to 'true'. Very useful for mathematical graphs.
+ Works for Lines, Points, LinesPoints and ErrorBars. Split makes
+ always a xy_plot. Defaults to 'false'.
+
+ 'min_y_ticks'
+ Sets the minimum number of y_ticks to draw when generating a scale.
+ Default is 6, The minimum is 2.
+
+ 'max_y_ticks'
+ Sets the maximum number of y_ticks to draw when generating a scale.
+ Default is 100. This limit is used to avoid plotting an unreasonable
+ large number of ticks if non-round values are used for the min_val
+ and max_val.
+
+ The value for 'max_y_ticks' should be at least 5 times larger than
+ 'min_y_ticks'.
+
+ 'max_x_ticks', 'min_x_ticks'
+ Work similar as 'max_y_ticks' and 'min_y_ticks'. Of course, only for
+ a xy_plot.
+
+ 'integer_ticks_only'
+ Specifies how to draw the x- and y-ticks: as floating point
+ ('false', '0') or as integer numbers ('true', 1). Default: 'false'
+
+ 'skip_int_ticks'
+ If 'integer_ticks_only' was set to 'true' the labels and ticks will
+ be drawn every nth tick. Of course in horizontalBars it affects the
+ x-axis. Default to 1, no skipping.
+
+ 'precision'
+ Sets the number of numerals after the decimal point. Affects in most
+ cases the y-axis. But also the x-axis if 'xy_plot' was set and also
+ the labels in a pie chart. Defaults to 3.
+
+ 'max_val'
+ Sets the maximum y-value on the graph, overriding the normal
+ auto-scaling. Default is undef.
+
+ 'min_val'
+ Sets the minimum y-value on the graph, overriding the normal
+ auto-scaling. Default is undef.
+
+ Caution should be used when setting 'max_val' and 'min_val' to
+ floating point or non-round numbers. This is because the scale must
+ start & end on a tick, ticks must have round-number intervals, and
+ include round numbers.
+
+ Example: Suppose your data set has a range of 35-114 units. If you
+ specify them as the 'min_val' & 'max_val', the y_axis will be
+ plotted with 80 ticks every 1 unit.. If no 'min_val' & 'max_val',
+ the system will auto scale the range to 30-120 with 10 ticks every
+ 10 units.
+
+ If the 'min_val' & 'max_val' are specified to excessive precision,
+ they may be overridden by the system, plotting a maximum
+ 'max_y_ticks' ticks.
+
+ 'include_zero'
+ If 'true', forces the y-axis to include zero if it is not in the
+ dataset range. Default is 'false'.
+
+ In general, it is better to use this, than to set the 'min_val' if
+ that is all you want to achieve.
+
+ 'pt_size'
+ Sets the radius of the points (for Chart::Points, etc.) in pixels.
+ Default is 18.
+
+ 'brush_size'
+ Sets the width of the lines (for Chart::Lines, etc.) in pixels.
+ Default is 6.
+
+ 'brushStyle'
+ Sets the shape of points for Chart::Points, Chart::LinesPoints. The
+ possibilities are 'FilledCircle', 'circle', 'donut', 'OpenCircle',
+ 'fatPlus', 'triangle', 'upsidedownTriangle', 'square',
+ 'hollowSquare', 'OpenRectangle', 'FilledDiamond', 'OpenDiamond',
+ 'Star', 'OpenStar'. Default: 'FilledCircle
+
+ 'skip_x_ticks'
+ Sets the number of x-ticks and x-tick labels to skip. (ie. if
+ 'skip_x_ticks' was set to 4, Chart would draw every 4th x-tick and
+ x-tick label). Default is undef.
+
+ 'custom_x_ticks'
+ Used in points, lines, linespoints, errorbars and bars charts, this
+ option allows you to you to specify exactly which x-ticks and x-tick
+ labels should be drawn. It should be assigned a reference to an
+ array of desired ticks. Just remember that I'm counting from the 0th
+ element of the array. (ie., if 'custom_x_ticks' is assigned [0,3,4],
+ then the 0th, 3rd, and 4th x-ticks will be displayed)
+
+ 'f_x_tick'
+ Needs a reference to a function which uses the x-tick labels
+ generated by the '@data[0]' as the argument. The result of this
+ function can reformat the labels. For instance
+
+ $obj -> set ('f_x_tick' => \&formatter );
+
+ An example for the function formatter: x labels are seconds since an
+ event. The referenced function can transform this seconds to hour,
+ minutes and seconds.
+
+ 'f_y_tick'
+ The same situation as for 'f_x_tick' but now used for y labels.
+
+ 'colors'
+ This option lets you control the colors the chart will use. It takes
+ a reference to a hash. The hash should contain keys mapped to
+ references to arrays of rgb values. For instance,
+
+ $obj->set('colors' => {'background' => [255,255,255]});
+
+ sets the background color to white (which is the default). Valid
+ keys for this hash are
+
+ 'background' (background color for the png)
+ 'title' (color of the title)
+ 'text' (all the text in the chart)
+ 'x_label' (color of the x-axis label)
+ 'y_label' (color of the first y axis label)
+ 'y_label2' (color of the second y axis label)
+ 'grid_lines' (color of the grid lines)
+ 'x_grid_lines' (color of the x grid lines - for x axis ticks)
+ 'y_grid_lines' (color of the y grid lines - for to left y axis ticks)
+ 'y2_grid_lines' (color of the y2 grid lines - for right y axis ticks)
+ 'dataset0'..'dataset63' (the different datasets)
+ 'misc' (everything else, ie. ticks, box around the legend)
+
+ NB. For composite charts, there is a limit of 8 datasets per
+ component. The colors for 'dataset8' through 'dataset15' become the
+ colors for 'dataset0' through 'dataset7' for the second component
+ chart.
+
+ 'title_font'
+ This option changes the font of the title. The key has to be a GD
+ font. eg. GD::Font->Large
+
+ 'label_font'
+ This option changes the font of the labels. The key has to be a GD
+ font.
+
+ 'legend_font'
+ This option changes the font of the text in the legend. The key has
+ to be a GD font.
+
+ 'tick_label_font'
+ This is the font for the tick labels. It also needs a GD font object
+ as an argument.
+
+ 'grey_background'
+ Puts a nice soft grey background on the actual data plot when set to
+ 'true'. Default is 'true'.
+
+ 'y_axes'
+ Tells Chart where to place the y-axis. Has no effect on Composite
+ and Pie. Valid values are 'left', 'right' and 'both'. Defaults to
+ 'left'.
+
+ 'x_grid_lines'
+ Draws grid lines matching up to x ticks if set to 'true'. Default is
+ false.
+
+ 'y_grid_lines'
+ Draws grid lines matching up to y ticks if set to 'true'. Default is
+ false.
+
+ 'grid_lines'
+ Draws grid lines matching up to x and y ticks.
+
+ 'spaced_bars'
+ Leaves space between the groups of bars at each data point when set
+ to 'true'. This just makes it easier to read a bar chart. Default is
+ 'true'.
+
+ 'imagemap'
+ Lets Chart know you're going to ask for information about the
+ placement of the data for use in creating an image map from the png.
+ This information can be retrieved using the imagemap_dump() method.
+ NB. that the imagemap_dump() method cannot be called until after the
+ Chart has been generated (ie. using the png() or cgi_png() methods).
+
+ 'sort'
+ In a xy-plot, the data will be sorted ascending if set to 'true'.
+ (Should be set if the data isn't sorted, especially in Lines, Split
+ and LinesPoints) In a Pareto Chart the data will be sorted
+ descending. Defaults to 'false'.
+
+ 'composite_info'
+ This option is only used for composite charts. It contains the
+ information about which types to use for the two component charts,
+ and which datasets belong to which component chart. It should be a
+ reference to an array of array references, containing information
+ like the following
+
+ $obj->set ('composite_info' => [ ['Bars', [1,2]],
+ ['Lines', [3,4] ] ]);
+
+ This example would set the two component charts to be a bar chart
+ and a line chart. It would use the first two data sets for the bar
+ chart (note that the numbering starts at 1, not zero like most of
+ the other numbered things in Chart), and the second two data sets
+ for the line chart. The default is undef.
+
+ NB. Chart::Composite can only do two component charts.
+
+ 'min_val1', 'min_val2'
+ Only for composite charts, these options specify the minimum y-value
+ for the first and second components respectively. Both default to
+ undef.
+
+ 'max_val1', 'max_val2'
+ Only for composite charts, these options specify the maximum y-value
+ for the first and second components respectively. Both default to
+ undef.
+
+ 'ylabel2'
+ The label for the right y-axis (the second component chart) on a
+ composite chart. Default is undef.
+
+ 'y_ticks1', 'y_ticks2'
+ The number of y ticks to use on the first and second y-axis on a
+ composite chart. Please note that if you just set the 'y_ticks'
+ option, both axes will use that number of y ticks. Both default to
+ undef.
+
+ 'f_y_ticks1', 'f_y_ticks2'
+ Only for composite charts, needs a reference to a function which has
+ one argument and has to return a string which labels the first resp.
+ second y axis. Both default to undef.
+
+ 'same_y_axes'
+ Forces both component charts in a composite chart to use the same
+ maximum and minimum y-values if set to 'true'. This helps to keep
+ the composite charts from being too confusing. Default is undef.
+
+ 'no_cache'
+ Adds Pragma: no-cache to the http header. Be careful with this one,
+ as Netscape 4.5 is unfriendly with POST using this method.
+
+ 'legend_example_size'
+ Sets the length of the example line in the legend in pixels.
+ Defaults to 20.
+
+ 'same_error'
+ This is a option only for ErrorBars. It tells chart that you want
+ use the same error value of a data point if set to 'true'. Look at
+ the documentation to see how the module ErrorBars works. Default:
+ 'false'.
+
+ 'skip_y_ticks'
+ Does the same for the y-axis at a HorizontalBars chart as
+ 'skip_x_ticks' does for other charts. Defaults to 1.
+
+ 'label_values'
+ Tells a pie chart what labels to draw beside the pie. Valid values
+ are 'percent', 'value', 'both' and 'none'. Defaults to 'percent'.
+
+ 'legend_label_values'
+ Tells a pie chart what labels to draw in the legend. Valid values
+ are 'percent', 'value', 'both' and 'none'. Defaults to 'value'.
+
+ 'start'
+ Required value for a split chart. Sets the start value of the first
+ interval. If the x coordinate of the first data point is zero, you
+ should 'set' to zero. Default is 'undef'.
+
+ 'interval'
+ Also a required value for a split chart. It sets the interval of one
+ line to plot. Defaults 'undef'.
+
+ 'interval_ticks'
+ Sets the number of ticks for the x-axis of a Split chart. Defaults
+ to 5.
+
+ 'scale'
+ Every y-value of a split chart will be multiplied with that value,
+ but the scale won't change. Which means that split allows one to
+ overdraw certain rows! Only useful if you want to give prominence to
+ the maximal amplitudes of the data. Defaults to 1.
+
+ 'point'
+ Indicates to draw points in a direction chart. 'true' or 'false'
+ possible. Defaults to 'true'.
+
+ 'line'
+ If you turn this option to 'true', then direction will connect the
+ points with lines. Defaults to 'false'.
+
+ 'arrow'
+ This is also an option for the direction module. If set to 'true',
+ chart will draw a arrow from the center to the point. Defaults to
+ 'false'.
+
+ 'angle_interval'
+ This option tells direction, how many angle lines should be drawn.
+ The default value is 30, which means that a line will be drawn every
+ 30 degrees. Valid Values are: 0, 5, 10, 15, 20, 30, 45 and 60. If
+ you choose 0, direction will draw no line.
+
+ 'min_circles'
+ Sets the minimum number of circles when generating a scale for
+ direction. Default is 4, minimum is 2.
+
+ 'max_circles'
+ Sets the maximum number of circles when generating a scale for
+ direction. Default is 100. This limit is used to avoid plotting an
+ unreasonable large number of ticks if non-round values are used for
+ the min_val and max_val.
+
+ 'pairs'
+ Only used for direction how to handle more datasets. If 'pairs' is
+ set to 'true', Chart uses the first dataset as a set of degrees and
+ the second dataset as a set of values. Then, the third set is a set
+ of degrees and the fourth a set of values \dots. \\ If 'pairs' is
+ set to 'false', Chart uses the first dataset as a set of angels and
+ all following datasets as sets of values. Defaults to 'false'.
+
+ Sets the maximum number of circles when generating a scale for
+ direction. Default is 100. This limit is used to avoid plotting an
+ unreasonable large number of ticks if non-round values are used for
+ the min_val and max_val.
+
+ GIFgraph.pm-style API
+ Sending the image to a file
+ Invoking the png method causes the graph to be plotted and saved to
+ a file. It takes the name of the output file and a reference to the
+ data as arguments. For example,
+
+ $obj->png ("foo.png", \@data);
+
+ would plot the data in @data, and the save the image to foo.png. Of
+ course, this then beggars the question "What should @data look
+ like?". Well, just like GIFgraph, @data should contain references to
+ arrays of data, with the first array reference pointing to an array
+ of x-tick labels. For example,
+
+ @data = ( [ 'foo', 'bar', 'junk' ],
+ [ 30.2, 23.5, 92.1 ] );
+
+ would set up a graph with one dataset, and three data points in that
+ set. In general, the @data array should look something like
+
+ @data = ( \@x_tick_labels, \@dataset1, ... , \@dataset_n );
+
+ And no worries, I make my own internal copy of the data, so that it
+ doesn't mess with yours.
+
+ CGI and Chart
+ Okay, so you're probably thinking, "Do I always have to save these
+ images to disk? What if I want to use Chart to create dynamic images
+ for my web site?" Well, here's the answer to that.
+
+ $obj->cgi_png ( \@data );
+
+ The cgi_png method will print the chart, along with the appropriate
+ http header, to stdout, allowing you to call chart-generating
+ scripts directly from your html pages (ie. with a <lt>img
+ src=image.pl<gt> HTML tag). The @data array should be set up the
+ same way as for the normal png method.
+
+ Graph.pm-style API
+ You might ask, "But what if I just want to add a few points to the
+ graph, and then display it, without all those references to
+ references?". Well, friend, the solution is simple. Borrowing the add_pt
+ idea from Matt Kruse's Graph module, you simply make a few calls to the
+ add_pt method, like so:
+
+ $obj->add_pt ('foo', 30, 25);
+ $obj->add_pt ('bar', 16, 32);
+
+ Or, if you want to be able to add entire datasets, simply use the
+ add_dataset method:
+
+ $obj->add_dataset ('foo', 'bar');
+ $obj->add_dataset (30, 16);
+ $obj->add_dataset (25, 32);
+
+ These methods check to make sure that the points and datasets you are
+ adding are the same size as the ones already there. So, if you have two
+ datasets currently stored, and try to add a data point with three
+ different values, it will carp (per the Carp module) an error message.
+ Similarly, if you try to add a dataset with 4 data points, and all the
+ other datasets have 3 data points, it will carp an error message.
+
+ Don't forget, when using this API, that I treat the first dataset as a
+ series of x-tick labels. So, in the above examples, the graph would have
+ two x-ticks, labeled 'foo' and 'bar', each with two data points. Pie and
+ ErrorBars handle it different, look at the documentation to see how it
+ works.
+
+ Adding a datafile
+ You can also add a complete datafile to a chart object. Just use the
+ add_datafile() method.
+
+ $obj->add_datafile('file', 'set' or 'pt');
+
+ file can be the name of the data file or a filehandle. 'set' or 'pt
+ is the type of the datafile. If the parameter is 'set' then each
+ line in the data file has to be a complete data set. The value of
+ the set has to be separated by white spaces. For example the file
+ looks like this:
+
+ 'foo' 'bar'
+ 30 16
+ 25 32
+
+ If the parameter is 'pt', one line has to include all values of one
+ data point separated by white spaces. For example:
+
+ 'foo' 30 25
+ 'bar' 16 32
+
+ Clearing the data
+ A simple call to the clear_data method empties any values that may
+ have been entered.
+
+ $obj->clear_data ();
+
+ Getting a copy of the data
+ If you want a copy of the data that has been added so far, make a
+ call to the get_data method like so:
+
+ $dataref = $obj->get_data;
+
+ It returns (you guessed it!) a reference to an array of references
+ to datasets. So the x-tick labels would be stored as
+
+ @x_labels = @{$dataref->[0]};
+
+ Sending the image to a file
+ If you just want to print this chart to a file, all you have to do
+ is pass the name of the file to the png() method.
+
+ $obj->png ("foo.png");
+
+ Sending the image to a filehandle
+ If you want to do something else with the image, you can also pass a
+ filehandle (either a typeglob or a FileHandle object) to png, and it
+ will print directly to that.
+
+ $obj->png ($filehandle);
+ $obj->png (FILEHANDLE);
+
+ CGI and Chart
+ Okay, so you're probably thinking (again), "Do I always have to save
+ these images to disk? What if I want to use Chart to create dynamic
+ images for my web site?" Well, here's the answer to that.
+
+ $obj->cgi_png ();
+
+ The cgi_png method will print the chart, along with the appropriate
+ http header, to stdout, allowing you to call chart-generating
+ scripts directly from your html pages (ie. with a <lt>img
+ src=image.pl<gt> HTML tag).
+
+ Produce a png image as a scalar
+ Like scalar_jpeg() the image is produced as a scalar so that the
+ programmer-user can do whatever the heck s/he wants to with it:
+
+ $obj-scalar_png($dataref)
+
+ Produce a jpeg image as a scalar
+ Like scalar_png() the image is produced as a scalar so that the
+ programmer-user can do whatever the heck s/he wants to with it:
+
+ $obj-scalar_jpeg($dataref)
+
+ Imagemap Support
+ Chart can also return the pixel positioning information so that you can
+ create image maps from the pngs Chart generates. Simply set the
+ 'imagemap' option to 'true' before you generate the png, then call the
+ imagemap_dump() method afterwards to retrieve the information. You will
+ be returned a data structure almost identical to the @data array
+ described above to pass the data into Chart.
+
+ $imagemap_data = $obj->imagemap_dump ();
+
+ Instead of single data values, you will be passed references to arrays
+ of pixel information. For Bars, HorizontalBars and StackedBars charts,
+ the arrays will contain two x-y pairs (specifying the upper left and
+ lower right corner of the bar), like so
+
+ ( $x1, $y1, $x2, $y2 ) = @{ $imagemap_data->[$dataset][$datapoint] };
+
+ For Lines, Points, ErrorBars, Split and LinesPoints, the arrays will
+ contain a single x-y pair (specifying the center of the point), like so
+
+ ( $x, $y ) = @{ $imagemap_data->[$dataset][$datapoint] };
+
+ A few caveats apply here. First of all, GD treats the upper-left corner
+ of the png as the (0,0) point, so positive y values are measured from
+ the top of the png, not the bottom. Second, these values will most
+ likely contain long decimal values. GD, of course, has to truncate these
+ to single pixel values. Since I don't know how GD does it, I can't
+ truncate it the same way he does. In a worst-case scenario, this will
+ result in an error of one pixel on your imagemap. If this is really an
+ issue, your only option is to either experiment with it, or to contact
+ Lincoln Stein and ask him. Third, please remember that the 0th dataset
+ will be empty, since that's the place in the @data array for the data
+ point labels.
+
+TO DO
+ * Add some 3-D graphs. Include True Type Fonts Violine and Box plots
+
+BUGS
+ Probably quite a few, since it's been completely rewritten. As usual,
+ please mail me with any bugs, patches, suggestions, comments, flames,
+ death threats, etc.
+
+AUTHOR
+ David Bonner (dbonner@cs.bu.edu)
+
+MAINTAINER
+ * Chart Group (Chart@fs.wettzell.de)
+
+ * Herbert Breunung (lichtkind@cpan.org)
+
+CONTRIBUTORS
+ * Gregor Herrmann (gregoa@debian.org)
+
+ * Chris Dolan (chris+rt@chrisdolan.net)
+
+ * (jarmzet@yahoo.com)
+
+ * Ricardo Signes (rjbs@cpan.org)
+
+ * Petr Pisar (ppisar@redhat.com)
+
+COPYRIGHT
+ Copyright(c) 1997-1998 by David Bonner, 1999 by Peter Clark, 2001 by the
+ Chart group at BKG-Wettzell. All rights reserved. This program is free
+ software; you can redistribute it and/or modify it under the same terms
+ as Perl itself.
+
diff --git a/Readme.md b/Readme.md
index 3e055f6..d0d789e 100644
--- a/Readme.md
+++ b/Readme.md
@@ -4,17 +4,17 @@
# VERSION
- 2.400.10
+ 2.401.1
# INSTALLING
The usual.
- perl Makefile.PL
- make
- make test
- make install
+ perl Makefile.PL
+ make
+ make test
+ make install
This should install to your site_perl directory. The test scripts also
put samples of the different charts in the samples/ directory.
@@ -28,7 +28,7 @@
# CHANGES
are in file Changes
-
+
# MAINTAINER
- Chart-Group (chart@fs.wettzell.de)
diff --git a/TODO b/TODO
index 2763b32..cd62b96 100755..100644
--- a/TODO
+++ b/TODO
@@ -1,51 +1,75 @@
-Short term:
------------
-- Composite:
- When using bars in both, an option is necessary to define whether
- to put the bars above each other or to put aside.
- Add an option to start x-ticks at the left (i.e. 0 point) side and
- end at the right side
+TODO's:
+-------
+
+General:
+--------
- Reorganize the relationship between
autoscale,
y_ticks, min_y_ticks, max_y_ticks, xy_plot, integer_ticks_only, skip_int_ticks,
min_val, max_val
and document it.
(At the moment the autoscale is used as the default)
-- Include Skyplot (Direction->polar) into the distribution
-- Add an option to lines, linespoints to start at (0,0) point not only
- if option xy_plot is active
-- Add chart type candlestick
-- Correct pie chart:
- - Add a flat pie chart where the legend appears on the left
- of the chart, and the chart itself is about 50% smaller
+- Add chart type candlestick (used for stock exchange plots)
+
+- include TrueType fonts
+- 3-D charts
+
+-
+
+Plottype specific:
+------------------
- Base class:
- - Some labels on the top of each axis not printed: i.e.,
- the graph goes to 100.6 but 100.6 is not printed.
- - Define an option to force the first point sits at the left border of
+ : Some labels on the top of each axis not printed: i.e.,
+ the graph goes to 100.6 but 100.6 is not printed.
+ : Define an option to force the first point sits at the left border of
the graph, and the last point sits at the right border, without any spaces.
-
+ : Add output for png without header as modperl generates the headers
+ by itsself.
+ : Add getopts(),
+ : Add dumpGetOpts(), i.e. list all options settings relevant for the
+ module(s) currently in use, and/or all options defined.
+
+- Composite:
+ : When using bars in both, an option is necessary to define whether
+ to put the bars above each other or to put aside.
+ : Add an option to start x-ticks at the left (i.e. 0 point) side and
+ end at the right side
+ : When combining LinePoints and Mountain the use of
+ min_val results in this error
+ "Use of uninitialized value in multiplication ..."
+ : support up to 3 chart types -
+ for example: Mountain, StackedBars, LinesPoints
+ (The number of chart types should be flexible in general)
+ : Add option to limit the y-ticks to just one side
+ : Define different brush_sizes for example with one Lines dataset
+ and one LinesPoints dataset.
+
+- pie chart:
+ : Add a flat pie chart where the legend appears on the left
+ of the chart, and the chart itself is about 50% smaller
+ : Add an option to reduce or remove all the border elements on the left,
+ on the right and on the bottom
+ : Allow to unset the title and remove the space occupied by the title,
+ i.e., make the plot bigger
+ : Add 3D appearance to the pies
+ : Set arbitrary background color to the pie (and make the pie visible in
+ the defined colors)
+ : Setup the ray of the pie
- Bars chart:
- - User would like to override the color of specific bars in a Chart::Bars graph.
- - Program should croak if a color is not defined for a bar.
- - Within one Bar graph, I have two datasets, but would like to change the
+ : User would like to override the color of specific bars in a Chart::Bars graph.
+ : Program should croak if a color is not defined for a bar.
+ : Within one Bar graph, I have two datasets, but would like to change the
width of one of them (it should have a width of 1, to indicate a limit).
+ : Within one Bar graph, I have two datasets, but would like to change the
+ width of one of them (it should have a width of 1, to indicate a limit).
+ : Show values on each bar
-- Composite chart:
- - Define different brush_sizes for example with one Lines dataset
- and one LinesPoints dataset.
-
-- Add output for png without header as modperl generates the headers
- by itsself.
-
-- Add output for gif again as the new GD module defines it again.
+- xy Plot:
+ : Add a feature to limit what is shown on the x axis
+ : include logarithmic x- and y-axis
+ : Let plot arbitrary xy-functions in a defined area, like
+ y=sin(1/x)+2*x
-Long term:
-----------
-- 3-D charts
-- include TrueType fonts as soon as GD supports it
-- include logarithmic x- and y-axis
-- Let plot arbitrary xy-functions in a defined area, like
- y=sin(1/x)+2*x
diff --git a/cpanfile b/cpanfile
index 2b2b3f4..a3a00fe 100644
--- a/cpanfile
+++ b/cpanfile
@@ -1,3 +1,14 @@
-requires 'perl', '5.012000';
-requires 'GD', 2;
-requires 'Carp', 1.35;
+# This file is generated by Dist::Zilla::Plugin::CPANFile v6.024
+# Do not edit this file directly. To change prereqs, edit the `dist.ini` file.
+
+requires "Carp" => "1.35";
+requires "GD" => "2";
+requires "perl" => "v5.12.0";
+
+on 'test' => sub {
+ requires "File::Temp" => "0.19";
+};
+
+on 'configure' => sub {
+ requires "ExtUtils::MakeMaker" => "0";
+};
diff --git a/dist.ini b/dist.ini
new file mode 100644
index 0000000..25636cc
--- /dev/null
+++ b/dist.ini
@@ -0,0 +1,49 @@
+name = Chart
+;main_module = lib/Chart.pm
+;abstract = a series of charting modules
+;version = 2.401.00
+author = Chart-Group <chartgrp@web.de>
+license = Artistic_2_0
+copyright_holder = Chart-Group <chartgrp@web.de>
+copyright_year = 1997-2022
+
+[Prereqs]
+perl = v5.12.0
+Carp = 1.35
+GD = 2
+
+[Prereqs / TestRequires]
+File::Temp = 0.19
+
+[MetaNoIndex]
+directory = t
+directory = patterns
+package = Chart::Base
+
+[Meta::Maintainers]
+maintainer = Herbert Breunung <lichtkind@cpan.org>
+
+
+[VersionFromModule]
+[AbstractFromPOD]
+[Pod2Readme]
+[MetaJSON]
+[MetaYAML]
+[MakeMaker]
+[License]
+[CPANFile]
+[Manifest]
+[GatherDir]
+prune_directory = ^utils$
+prune_directory = ^samples$
+
+[TestRelease]
+[ConfirmRelease]
+[UploadToCPAN]
+
+
+;[MetaProvides::Package]
+;Chart::Pie = 2.400.5
+
+;[PodSyntaxTests]
+;[PodCoverageTests]
diff --git a/doc/LaTeX/Documentation.tex b/doc/LaTeX/Documentation.tex
index a8723a6..fc1f1a5 100644
--- a/doc/LaTeX/Documentation.tex
+++ b/doc/LaTeX/Documentation.tex
@@ -33,7 +33,7 @@
\sloppy
\title{Documentation for Perl Package \textbf{Chart}\\
-{\Large Version 2.4.8}
+ {\Large Version 2.400.1}
}
%% Name der Autoren
@@ -73,6 +73,7 @@ D-93444 Bad K\"otzting, E-mail: chart@fs.wettzell.de}}
\include{Points}
\include{Split}
\include{Stacked}
+%\include{Colors}
\include{Appendix}
\clearpage
\printindex
diff --git a/lib/Chart.pm b/lib/Chart.pm
index d801638..06412c3 100644
--- a/lib/Chart.pm
+++ b/lib/Chart.pm
@@ -1,7 +1,6 @@
package Chart;
-
-our $VERSION = 2.400.10;
+our $VERSION = 2.401.1;
1;
@@ -21,8 +20,8 @@ Chart - a series of charting modules
$obj->set ( $key_1, $val_1, ... ,$key_n, $val_n );
$obj->set ( $key_1 => $val_1,
- ...
- $key_n => $val_n );
+ ...
+ $key_n => $val_n );
$obj->set ( %hash );
# GIFgraph.pm-style API to produce png formatted charts
@@ -304,23 +303,23 @@ This option lets you control the colors the chart will use. It takes
a reference to a hash. The hash should contain keys mapped to references
to arrays of rgb values. For instance,
- $obj->set('colors' => {'background' => [255,255,255]});
+ $obj->set('colors' => {'background' => [255,255,255]});
sets the background color to white (which is the default). Valid keys for
this hash are
- 'background' (background color for the png)
- 'title' (color of the title)
- 'text' (all the text in the chart)
- 'x_label' (color of the x-axis label)
- 'y_label' (color of the first y axis label)
- 'y_label2' (color of the second y axis label)
- 'grid_lines' (color of the grid lines)
- 'x_grid_lines' (color of the x grid lines - for x axis ticks)
- 'y_grid_lines' (color of the y grid lines - for to left y axis ticks)
- 'y2_grid_lines' (color of the y2 grid lines - for right y axis ticks)
- 'dataset0'..'dataset63' (the different datasets)
- 'misc' (everything else, ie. ticks, box around the legend)
+ 'background' (background color for the png)
+ 'title' (color of the title)
+ 'text' (all the text in the chart)
+ 'x_label' (color of the x-axis label)
+ 'y_label' (color of the first y axis label)
+ 'y_label2' (color of the second y axis label)
+ 'grid_lines' (color of the grid lines)
+ 'x_grid_lines' (color of the x grid lines - for x axis ticks)
+ 'y_grid_lines' (color of the y grid lines - for to left y axis ticks)
+ 'y2_grid_lines' (color of the y2 grid lines - for right y axis ticks)
+ 'dataset0'..'dataset63' (the different datasets)
+ 'misc' (everything else, ie. ticks, box around the legend)
NB. For composite charts, there is a limit of 8 datasets per component.
The colors for 'dataset8' through 'dataset15' become the colors
@@ -396,8 +395,8 @@ and which datasets belong to which component chart. It should be
a reference to an array of array references, containing information
like the following
- $obj->set ('composite_info' => [ ['Bars', [1,2]],
- ['Lines', [3,4] ] ]);
+ $obj->set ('composite_info' => [ ['Bars', [1,2]],
+ ['Lines', [3,4] ] ]);
This example would set the two component charts to be a bar chart and
a line chart. It would use the first two data sets for the bar
@@ -567,7 +566,7 @@ to arrays of data, with the first array reference pointing to an
array of x-tick labels. For example,
@data = ( [ 'foo', 'bar', 'junk' ],
- [ 30.2, 23.5, 92.1 ] );
+ [ 30.2, 23.5, 92.1 ] );
would set up a graph with one dataset, and three data points in that
set. In general, the @data array should look something like
@@ -631,7 +630,7 @@ to see how it works.
You can also add a complete datafile to a chart object. Just use the
add_datafile() method.
- $obj->add_datafile('file', 'set' or 'pt');
+ $obj->add_datafile('file', 'set' or 'pt');
file can be the name of the data file or a filehandle.
'set' or 'pt is the type of the datafile.
@@ -639,15 +638,15 @@ If the parameter is 'set' then each line in the data file
has to be a complete data set. The value of the set has to be
separated by white spaces. For example the file looks like this:
- 'foo' 'bar'
- 30 16
- 25 32
+ 'foo' 'bar'
+ 30 16
+ 25 32
If the parameter is 'pt', one line has to include all values
of one data point separated by white spaces. For example:
- 'foo' 30 25
- 'bar' 16 32
+ 'foo' 30 25
+ 'bar' 16 32
=item Clearing the data
@@ -662,19 +661,19 @@ have been entered.
If you want a copy of the data that has been added so far, make a call
to the get_data method like so:
- $dataref = $obj->get_data;
+ $dataref = $obj->get_data;
It returns (you guessed it!) a reference to an array of references to
datasets. So the x-tick labels would be stored as
- @x_labels = @{$dataref->[0]};
+ @x_labels = @{$dataref->[0]};
=item Sending the image to a file
If you just want to print this chart to a file, all you have to do
is pass the name of the file to the png() method.
- $obj->png ("foo.png");
+ $obj->png ("foo.png");
=item Sending the image to a filehandle
@@ -682,8 +681,8 @@ If you want to do something else with the image, you can also pass
a filehandle (either a typeglob or a FileHandle object) to png, and
it will print directly to that.
- $obj->png ($filehandle);
- $obj->png (FILEHANDLE);
+ $obj->png ($filehandle);
+ $obj->png (FILEHANDLE);
=item CGI and Chart
@@ -692,7 +691,7 @@ Okay, so you're probably thinking (again), "Do I always have to save these
images to disk? What if I want to use Chart to create dynamic images for
my web site?" Well, here's the answer to that.
- $obj->cgi_png ();
+ $obj->cgi_png ();
The cgi_png method will print the chart, along with the appropriate http
header, to stdout, allowing you to call chart-generating scripts directly
@@ -705,7 +704,7 @@ Like scalar_jpeg() the image is produced as a scalar
so that the programmer-user can do whatever the heck
s/he wants to with it:
- $obj-scalar_png($dataref)
+ $obj-scalar_png($dataref)
@@ -715,8 +714,8 @@ Like scalar_png() the image is produced as a scalar
so that the programmer-user can do whatever the heck
s/he wants to with it:
- $obj-scalar_jpeg($dataref)
-
+ $obj-scalar_jpeg($dataref)
+
=back
=head2 Imagemap Support
@@ -728,19 +727,19 @@ method afterwards to retrieve the information. You will be returned a
data structure almost identical to the @data array described above to pass
the data into Chart.
- $imagemap_data = $obj->imagemap_dump ();
+ $imagemap_data = $obj->imagemap_dump ();
Instead of single data values, you will be passed references to arrays
of pixel information. For Bars, HorizontalBars and StackedBars charts,
the arrays will contain two x-y pairs (specifying the upper left and
lower right corner of the bar), like so
- ( $x1, $y1, $x2, $y2 ) = @{ $imagemap_data->[$dataset][$datapoint] };
+ ( $x1, $y1, $x2, $y2 ) = @{ $imagemap_data->[$dataset][$datapoint] };
For Lines, Points, ErrorBars, Split and LinesPoints, the arrays will contain
a single x-y pair (specifying the center of the point), like so
- ( $x, $y ) = @{ $imagemap_data->[$dataset][$datapoint] };
+ ( $x, $y ) = @{ $imagemap_data->[$dataset][$datapoint] };
A few caveats apply here. First of all, GD treats the upper-left corner
of the png as the (0,0) point, so positive y values are measured from the
@@ -767,8 +766,6 @@ Violine and Box plots
=back
-For elaborate plans look into the L<TODO|../TODO>.
-
=head1 BUGS
Probably quite a few, since it's been completely rewritten. As usual,
@@ -781,9 +778,48 @@ David Bonner (dbonner@cs.bu.edu)
=head1 MAINTAINER
+=over 4
+
+=item *
+
Chart Group (Chart@fs.wettzell.de)
+
+=item *
+
Herbert Breunung (lichtkind@cpan.org)
+=back
+
+=head1 CONTRIBUTORS
+
+=over 4
+
+
+=item *
+
+Gregor Herrmann (gregoa@debian.org)
+
+=item *
+
+Chris Dolan (chris+rt@chrisdolan.net)
+
+=item *
+
+(jarmzet@yahoo.com)
+
+=item *
+
+Ricardo Signes (rjbs@cpan.org)
+
+=item *
+
+Petr Pisar (ppisar@redhat.com)
+
+
+
+=back
+
+
=head1 COPYRIGHT
Copyright(c) 1997-1998 by David Bonner, 1999 by Peter Clark,
diff --git a/lib/Chart/Bars.pm b/lib/Chart/Bars.pm
index 1da9648..e682af5 100644
--- a/lib/Chart/Bars.pm
+++ b/lib/Chart/Bars.pm
@@ -1,46 +1,31 @@
-## @file
-# Implementation of Chart::Bars
-#
-# written by
-# @author david bonner (dbonner@cs.bu.edu)
-#
-# maintained by the
-# @author Chart Group at Geodetic Fundamental Station Wettzell (Chart@fs.wettzell.de)
-# @date 2015-03-01
-# @version 2.4.10
-## @class Chart::Bars
-# Bars class provides all functions which are specific to
# vertical bars
-use strict;
+
+use v5.12;
package Chart::Bars;
+our @ISA = qw(Chart::Base);
our $VERSION = 2.400.5;
-@Chart::Bars::ISA = qw(Chart::Base);
use Chart::Base;
use GD;
use Carp;
#>>>>>>>>>>>>>>>>>>>>>>>>>>#
-# public methods go here #
+# public methods #
#<<<<<<<<<<<<<<<<<<<<<<<<<<#
#>>>>>>>>>>>>>>>>>>>>>>>>>>>#
-# private methods go here #
+# private methods #
#<<<<<<<<<<<<<<<<<<<<<<<<<<<#
-## @method private _draw_data
-# @brief
-# finally get around to plotting the data for (vertical) bars
+## _draw_data : plotting the data for (vertical) bars
#
-# @details
-# The user may define the kind of labelling the data by setting\n
-# 'label_values' to 'value' if she wants to have the absolut values\n
-# 'label_values' to 'none' if she wants to have no values (default)\n
+# The user may define the kind of labelling the data by setting
+# 'label_values' to 'value' if she wants to have the absolut values
+# 'label_values' to 'none' if she wants to have no values (default)
#
-sub _draw_data
-{
+sub _draw_data {
my $self = shift;
my $data = $self->{'dataref'};
@@ -242,5 +227,4 @@ sub _draw_data
}
-## be a good module and return 1
-1;
+1; # be a good module and return 1
diff --git a/lib/Chart/Base.pm b/lib/Chart/Base.pm
index ce9811a..79e319b 100644
--- a/lib/Chart/Base.pm
+++ b/lib/Chart/Base.pm
@@ -1,73 +1,38 @@
-## @file
-# Implementation of Chart::Base
-#
-# written by
-# @author david bonner (dbonner@cs.bu.edu)
-#
-# maintained by the
-# @author Chart Group at Geodetic Fundamental Station Wettzell (Chart@fs.wettzell.de)
-# @date 2015-03-01
-# @version 2.400.1
-## @mainpage Chart::Base
-#
-# Basic Class of Chart from which all the other classes are derived.
+# Chart::Base : all other drawing classes ared derived from this
+# provides all common functions
+
+use v5.12;
-## @class Chart::Base
-# @brief Base class for Chart; all other classes derived from here
-#
-# Base class from which all other classes are derived.
-# This class provides all functions which are common for
-# all classes
package Chart::Base;
-our $VERSION = 2.400.5;
+our $VERSION = '2.400.5';
-use GD;
-use Carp;
use FileHandle;
-use Chart::Constants;
+use Carp;
+use GD;
use GD::Image;
-
-use vars qw(%named_colors);
-use strict;
+use Chart::Constants;
#>>>>>>>>>>>>>>>>>>>>>>>>>>#
-# public methods go here #
+# public methods #
#<<<<<<<<<<<<<<<<<<<<<<<<<<#
-## @cmethod object new()
-# @return A new object.
-#
-# @brief
-# Standard normal constructor.\n
-# Calls
-# @see _init
-sub new
+sub new # Standard normal constructor
{
my $proto = shift;
my $class = ref($proto) || $proto;
- my $self = {};
+ my $self = (bless {}, $class) ;
- bless $self, $class;
$self->_init(@_);
-
return $self;
}
-## @method int set(%opts)
-# Set all options
-#
-# @details
-# main method for customizing the chart, lets users
-# specify values for different parameters\n
-# The options are saved locally to be able to output them
-# via @see getopts()
-#
-# @param[in] opts Hash of options to the Chart
-# @return ok or croak
-#
-sub set
-{
+
+# set (%options) --> 1 | croak
+# main method for customizing the chart, by specify parameters
+# options are saved locally to be able to output them via @see getopts()
+
+sub set {
my $self = shift;
my %opts = @_;
@@ -113,16 +78,13 @@ sub set
$self->{'colors'}{'x_grid_lines'} = $sLocal;
$self->{'colors'}{'y2_grid_lines'} = $sLocal;
}
- else
- {
+ else {
carp "colors{'grid_lines'} is not SCALAR and not ARRAY\n";
}
}
}
}
}
-
- # now return
return 1;
}
@@ -1307,7 +1269,7 @@ sub _draw
return 1;
}
-## @var Hash named_colors RGB values of named colors
+## @var Hash named_colors RGB values of named colors
#
# see URL http://en.wikipedia.org/wiki/Web_colors#X11_color_names
our %named_colors = (
@@ -1910,17 +1872,17 @@ sub _draw_title
# Sketch for further processing
# if ( $font ~= /^gd/ && ! -f $font )
# {
- # $self->{'gd_obj'}->string( $font, $x, $y, $lines[0], $color );
- # }
- # elsif ( -f $font )
- # {
- # my $fontname = '/var/share/fonts/truetype/freefont/FreeSerifBoldItalic.ttf';
- # $self->{'gd_obj'}->stringFT( $color, $fontname, 8,0, $x, $y, $lines[0] );
- # }
-
- # my $fontname = '/var/share/fonts/truetype/freefont/FreeSerifBoldItalic.ttf';
+ # $self->{'gd_obj'}->string( $font, $x, $y, $lines[0], $color );
+ # }
+ # elsif ( -f $font )
+ # {
+ # my $fontname = '/var/share/fonts/truetype/freefont/FreeSerifBoldItalic.ttf';
+ # $self->{'gd_obj'}->stringFT( $color, $fontname, 8,0, $x, $y, $lines[0] );
+ # }
+
+ # my $fontname = '/var/share/fonts/truetype/freefont/FreeSerifBoldItalic.ttf';
# # size, angle
- # $self->{'gd_obj'}->stringFT( $color, $fontname, 12,0, $x, $y, $lines[0] );
+ # $self->{'gd_obj'}->stringFT( $color, $fontname, 12,0, $x, $y, $lines[0] );
#-----------------------------------------------------------------
$self->{'gd_obj'}->string( $font, $x, $y, $lines[0], $color );
@@ -2146,12 +2108,12 @@ sub _find_x_scale
# This Sub calculates correct values for the following class local variables,
# if they have not been set by the user.
#
-# max_val, min_val: The maximum and minimum values for the y axis.\n
-# y_ticks: The number of ticks to plot on the y scale, including
-# the end points. e.g. If the scale runs from 0 to 50,
-# with ticks every 10, y_ticks will have the value of 6.\n
-# y_tick_labels: An array of strings, each is a label for the y axis.\n
-# y_tick_labels_length: The length to allow for B tick labels. (How long is
+# max_val, min_val: The maximum and minimum values for the y axis.\n
+# y_ticks: The number of ticks to plot on the y scale, including
+# the end points. e.g. If the scale runs from 0 to 50,
+# with ticks every 10, y_ticks will have the value of 6.\n
+# y_tick_labels: An array of strings, each is a label for the y axis.\n
+# y_tick_labels_length: The length to allow for B tick labels. (How long is
# the longest?)
sub _find_y_scale
{
@@ -4485,7 +4447,6 @@ sub _prepare_brush
if ( $brushStyle eq 'fatPlus' )
{
my $poly = new GD::Polygon;
-
my $z = int( 0.3 * $radius );
$poly->addPt( $xc + $z, $yc + $z );
@@ -4590,7 +4551,6 @@ sub _prepare_brush
}
}
-
# set the new image as the main object's brush
return $brush;
}
@@ -4615,13 +4575,10 @@ sub _default_f_tick
sub _xyRatio
{
my $self = shift;
-
my $width_x = $self->{'curr_x_max'} - $self->{'curr_x_min'} + 1;
my $width_y = $self->{'curr_y_max'} - $self->{'curr_y_min'} + 1;
- my $ratio = $width_x / $width_y;
-
- return $ratio;
+ return $width_x / $width_y;
}
## @fn private float _xPixelInReal
@@ -4632,13 +4589,11 @@ sub _xyRatio
sub _xPixelInReal
{
my $self = shift;
-
my $width_x = $self->{'curr_x_max'} - $self->{'curr_x_min'} + 1;
my ( $min, $max ) = $self->_find_x_range();
my $xRealWidth = $max - $min;
- my $ratio = $xRealWidth / $width_x;
- return $ratio;
+ return $xRealWidth / $width_x;
}
## @fn private float _yPixelInReal
@@ -4649,15 +4604,13 @@ sub _xPixelInReal
sub _yPixelInReal
{
my $self = shift;
-
my $width_y = $self->{'curr_y_max'} - $self->{'curr_y_min'} + 1;
my ( $min, $max, $flag_all_integers ) = $self->_find_y_range();
my $yRealWidth = $max - $min;
- my $ratio = $yRealWidth / $width_y;
-
- return $ratio;
+
+ return $yRealWidth / $width_y;
}
-## be a good module and return positive
-1;
+
+1; # be a good module and return positive
diff --git a/lib/Chart/BrushStyles.pm b/lib/Chart/BrushStyles.pm
index d74529f..9b0128d 100644
--- a/lib/Chart/BrushStyles.pm
+++ b/lib/Chart/BrushStyles.pm
@@ -1,41 +1,23 @@
-## @file
-# Chart::BrushStyles
-#
-# written and maintained by the
-# @author Chart Group at Geodetic Fundamental Station Wettzell (Chart@fs.wettzell.de)
-# @date 2015-03-01
-# @version 2.4.10
-#
-
-## @class Chart::BrushStyles
-# Define styles for Points and LinesPoints classes
-#
-# This class provides functions which define different
-# brush styles to extend the previous point as the only design
-# for Points.pm or LinesPoints.pm\n\n
-# The different brush styles are:\n
-# \see OpenCircle\n
-# \see FilledCircle\n
-# \see Star\n
-# \see OpenDiamond\n
-# \see FilledDiamond\n
-# \see OpenRectangle\n
-# \see FilledRectangle\n
+
+# styles for Points and LinesPoints classes
+
+use v5.12;
+
package Chart::BrushStyles;
our $VERSION = 2.400.5;
-use Chart::Base;
-use GD;
+
use Carp;
-use strict;
+use GD;
use Chart::Constants;
+use Chart::Base;
+
-@Chart::BrushStyles::ISA = qw(Chart::Base);
## @fn OpenCircle
# @param[in] *GD::Image $rbrush Reference to GD::Image
# @param[in] int $radius Radius of the point in pixels
-# @param[in] int $color Color of the not filled point
+# @param[in] int $color
#
# @brief Set the gdBrush object to have nice brushed object
# representing a circle of the size \$radius.
@@ -51,8 +33,8 @@ sub OpenCircle
{
my $self = shift;
my $rbrush = shift; # reference to GD::Image
- my $radius = shift;
- my $color = shift;
+ my $radius = shift; # radius of the point in pixels
+ my $color = shift; # Color of the not filled point
# draw a filled circle
if ( $radius < 2 ) { $radius = 2; }
@@ -232,13 +214,12 @@ sub OpenRectangle
my $radius = shift;
my $color = shift;
- # draw a filled circle
if ( $radius < 2 ) { $radius = 2; }
-
my $height = $radius;
my $width = $radius / 2;
if ( $width < 1 ) { $width = 1; }
+ # draw a filled circle
$$rbrush->line( -$width, -$height, $width, -$height, $color );
#$$rbrush->line( $width, -$height, $width, $height, $color );
@@ -246,5 +227,4 @@ sub OpenRectangle
#$$rbrush->line( -$width, $height, -$width ,-$height,$color );
}
-#################################################################
1;
diff --git a/lib/Chart/Color.pm b/lib/Chart/Color.pm
new file mode 100644
index 0000000..3d8c0be
--- /dev/null
+++ b/lib/Chart/Color.pm
@@ -0,0 +1,60 @@
+
+# Chart::Color: color object with basic color space method and conversion
+
+use v5.12;
+
+package Chart::Color;
+
+use Chart::Color::Named;
+use Chart::Color::Scheme;
+
+
+sub new {
+ my ($pkg) = shift;
+ return "need 3 arguments in hash form e.g. (r => 1, g => 2, b => 3)" unless @_ == 6;
+ my $hash = {lc($_[0]) => $_[1], lc($_[2]) => $_[3], lc($_[4]) => $_[5] };
+ my ($self, $rest);
+ if (exists $hash->{'r'} and exists $hash->{'g'} and exists $hash->{'b'}) {
+ $rest = rgb_to_hsl( $hash->{'r'}, $hash->{'g'}, $hash->{'b'} );
+ return "RGB values are out of range" unless ref $rest eq 'ARRAY';
+ $self = [$hash->{'r'}, $hash->{'g'}, $hash->{'b'}, @$rest];
+ } elsif (exists $hash->{'h'} and exists $hash->{'s'} and exists $hash->{'l'}) {
+ $rest = hsl_to_rgb( $hash->{'h'}, $hash->{'s'}, $hash->{'l'} );
+ return "HSL values are out of range" unless ref $rest eq 'ARRAY';
+ $self = [@$rest, $hash->{'h'}, $hash->{'s'}, $hash->{'l'}];
+ } else { return "need argument keys to be r, g, b or h, s, l" }
+ bless $self;
+}
+
+
+sub rgb { @{$_[0]}[0 .. 2] }
+sub hsl { @{$_[0]}[3 .. 5] }
+sub hex { sprintf "%x%x%x", @{$_[0]}[0 .. 2]}
+
+sub rgb_to_hsl{
+ my ($r, $g, $b) = @_;
+}
+
+sub hsl_to_rgb {
+ my ($h, $s, $l) = @_;
+}
+
+
+sub add {
+ my ($self) = shift;
+}
+
+sub distance {
+ my ($self) = shift;
+}
+
+sub gradient {
+ my ($self) = shift;
+}
+
+
+1;
+
+__END__
+
+
diff --git a/lib/Chart/Color/Named.pm b/lib/Chart/Color/Named.pm
new file mode 100644
index 0000000..19ad9d9
--- /dev/null
+++ b/lib/Chart/Color/Named.pm
@@ -0,0 +1,502 @@
+
+# Chart::Color::Named : expandable store of all predefined color names
+
+use v5.12;
+
+package Chart::Color::Named;
+
+our %store = ( # http://en.wikipedia.org/wiki/Web_colors#X11_color_names
+ 'white' => [ 255, 255, 255 ],
+ 'black' => [ 0, 0, 0 ],
+ 'red' => [ 200, 0, 0 ],
+ 'green' => [ 0, 175, 0 ],
+ 'blue' => [ 0, 0, 200 ],
+ 'orange' => [ 250, 125, 0 ],
+ 'orange2' => [ 238, 154, 0 ],
+ 'orange3' => [ 205, 133, 0 ],
+ 'orange4' => [ 139, 90, 0 ],
+ 'yellow' => [ 225, 225, 0 ],
+ 'purple' => [ 200, 0, 200 ],
+ 'light_blue' => [ 0, 125, 250 ],
+ 'light_green' => [ 125, 250, 0 ],
+ 'light_purple' => [ 145, 0, 250 ],
+ 'pink' => [ 250, 0, 125 ],
+ 'peach' => [ 250, 125, 125 ],
+ 'olive' => [ 125, 125, 0 ],
+ 'plum' => [ 125, 0, 125 ],
+ 'turquoise' => [ 0, 125, 125 ],
+ 'mauve' => [ 200, 125, 125 ],
+ 'brown' => [ 160, 80, 0 ],
+ 'grey' => [ 225, 225, 225 ],
+ 'HotPink' => [ 255, 105, 180 ],
+ 'PaleGreen1' => [ 154, 255, 154 ],
+ 'PaleGreen2' => [ 144, 238, 144 ],
+ 'PaleGreen3' => [ 124, 205, 124 ],
+ 'PaleGreen4' => [ 84, 138, 84 ],
+ 'DarkBlue' => [ 0, 0, 139 ],
+ 'BlueViolet' => [ 138, 43, 226 ],
+ 'PeachPuff' => [ 255, 218, 185 ],
+ 'PeachPuff1' => [ 255, 218, 185 ],
+ 'PeachPuff2' => [ 238, 203, 173 ],
+ 'PeachPuff3' => [ 205, 175, 149 ],
+ 'PeachPuff4' => [ 139, 119, 101 ],
+ 'chocolate1' => [ 255, 127, 36 ],
+ 'chocolate2' => [ 238, 118, 33 ],
+ 'chocolate3' => [ 205, 102, 29 ],
+ 'chocolate4' => [ 139, 69, 19 ],
+ 'LightGreen' => [ 144, 238, 144 ],
+ 'lavender' => [ 230, 230, 250 ],
+ 'MediumPurple' => [ 147, 112, 219 ],
+ 'DarkOrange' => [ 255, 127, 0 ],
+ 'DarkOrange2' => [ 238, 118, 0 ],
+ 'DarkOrange3' => [ 205, 102, 0 ],
+ 'DarkOrange4' => [ 139, 69, 0 ],
+ 'SlateBlue' => [ 106, 90, 205 ],
+ 'BlueViolet' => [ 138, 43, 226 ],
+ 'RoyalBlue' => [ 65, 105, 225 ],
+ 'AntiqueWhite' => [ 250, 235, 215 ],
+ 'AntiqueWhite1' => [ 255, 239, 219 ],
+ 'AntiqueWhite2' => [ 238, 223, 204 ],
+ 'AntiqueWhite3' => [ 205, 192, 176 ],
+ 'AntiqueWhite4' => [ 139, 131, 120 ],
+ 'CadetBlue' => [ 95, 158, 160 ],
+ 'CadetBlue1' => [ 152, 245, 255 ],
+ 'CadetBlue2' => [ 142, 229, 238 ],
+ 'CadetBlue3' => [ 122, 197, 205 ],
+ 'CadetBlue4' => [ 83, 134, 139 ],
+ 'DarkGoldenrod' => [ 184, 134, 11 ],
+ 'DarkGoldenrod1' => [ 255, 185, 15 ],
+ 'DarkGoldenrod2' => [ 238, 173, 14 ],
+ 'DarkGoldenrod3' => [ 205, 149, 12 ],
+ 'DarkGoldenrod4' => [ 139, 101, 8 ],
+ 'DarkOliveGreen' => [ 85, 107, 47 ],
+ 'DarkOliveGreen1' => [ 202, 255, 112 ],
+ 'DarkOliveGreen2' => [ 188, 238, 104 ],
+ 'DarkOliveGreen3' => [ 162, 205, 90 ],
+ 'DarkOliveGreen4' => [ 110, 139, 61 ],
+ 'DarkOrange1' => [ 255, 127, 0 ],
+ 'DarkOrchid' => [ 153, 50, 204 ],
+ 'DarkOrchid1' => [ 191, 62, 255 ],
+ 'DarkOrchid2' => [ 178, 58, 238 ],
+ 'DarkOrchid3' => [ 154, 50, 205 ],
+ 'DarkOrchid4' => [ 104, 34, 139 ],
+ 'DarkSeaGreen' => [ 143, 188, 143 ],
+ 'DarkSeaGreen1' => [ 193, 255, 193 ],
+ 'DarkSeaGreen2' => [ 180, 238, 180 ],
+ 'DarkSeaGreen3' => [ 155, 205, 155 ],
+ 'DarkSeaGreen4' => [ 105, 139, 105 ],
+ 'DarkSlateGray' => [ 47, 79, 79 ],
+ 'DarkSlateGray1' => [ 151, 255, 255 ],
+ 'DarkSlateGray2' => [ 141, 238, 238 ],
+ 'DarkSlateGray3' => [ 121, 205, 205 ],
+ 'DarkSlateGray4' => [ 82, 139, 139 ],
+ 'DeepPink' => [ 255, 20, 147 ],
+ 'DeepPink1' => [ 255, 20, 147 ],
+ 'DeepPink2' => [ 238, 18, 137 ],
+ 'DeepPink3' => [ 205, 16, 118 ],
+ 'DeepPink4' => [ 139, 10, 80 ],
+ 'DeepSkyBlue' => [ 0, 191, 255 ],
+ 'DeepSkyBlue1' => [ 0, 191, 255 ],
+ 'DeepSkyBlue2' => [ 0, 178, 238 ],
+ 'DeepSkyBlue3' => [ 0, 154, 205 ],
+ 'DeepSkyBlue4' => [ 0, 104, 139 ],
+ 'DodgerBlue' => [ 30, 144, 255 ],
+ 'DodgerBlue1' => [ 30, 144, 255 ],
+ 'DodgerBlue2' => [ 28, 134, 238 ],
+ 'DodgerBlue3' => [ 24, 116, 205 ],
+ 'DodgerBlue4' => [ 16, 78, 139 ],
+ 'HotPink1' => [ 255, 110, 180 ],
+ 'HotPink2' => [ 238, 106, 167 ],
+ 'HotPink3' => [ 205, 96, 144 ],
+ 'HotPink4' => [ 139, 58, 98 ],
+ 'IndianRed' => [ 205, 92, 92 ],
+ 'IndianRed1' => [ 255, 106, 106 ],
+ 'IndianRed2' => [ 238, 99, 99 ],
+ 'IndianRed3' => [ 205, 85, 85 ],
+ 'IndianRed4' => [ 139, 58, 58 ],
+ 'LavenderBlush' => [ 255, 240, 245 ],
+ 'LavenderBlush1' => [ 255, 240, 245 ],
+ 'LavenderBlush2' => [ 238, 224, 229 ],
+ 'LavenderBlush3' => [ 205, 193, 197 ],
+ 'LavenderBlush4' => [ 139, 131, 134 ],
+ 'LemonChiffon' => [ 255, 250, 205 ],
+ 'LemonChiffon1' => [ 255, 250, 205 ],
+ 'LemonChiffon2' => [ 238, 233, 191 ],
+ 'LemonChiffon3' => [ 205, 201, 165 ],
+ 'LemonChiffon4' => [ 139, 137, 112 ],
+ 'LightBlue' => [ 173, 216, 230 ],
+ 'LightBlue1' => [ 191, 239, 255 ],
+ 'LightBlue2' => [ 178, 223, 238 ],
+ 'LightBlue3' => [ 154, 192, 205 ],
+ 'LightBlue4' => [ 104, 131, 139 ],
+ 'LightCyan' => [ 224, 255, 255 ],
+ 'LightCyan1' => [ 224, 255, 255 ],
+ 'LightCyan2' => [ 209, 238, 238 ],
+ 'LightCyan3' => [ 180, 205, 205 ],
+ 'LightCyan4' => [ 122, 139, 139 ],
+ 'LightGoldenrod' => [ 238, 221, 130 ],
+ 'LightGoldenrod1' => [ 255, 236, 139 ],
+ 'LightGoldenrod2' => [ 238, 220, 130 ],
+ 'LightGoldenrod3' => [ 205, 190, 112 ],
+ 'LightGoldenrod4' => [ 139, 129, 76 ],
+ 'LightPink' => [ 255, 182, 193 ],
+ 'LightPink1' => [ 255, 174, 185 ],
+ 'LightPink2' => [ 238, 162, 173 ],
+ 'LightPink3' => [ 205, 140, 149 ],
+ 'LightPink4' => [ 139, 95, 101 ],
+ 'LightSalmon' => [ 255, 160, 122 ],
+ 'LightSalmon1' => [ 255, 160, 122 ],
+ 'LightSalmon2' => [ 238, 149, 114 ],
+ 'LightSalmon3' => [ 205, 129, 98 ],
+ 'LightSalmon4' => [ 139, 87, 66 ],
+ 'LightSkyBlue' => [ 135, 206, 250 ],
+ 'LightSkyBlue1' => [ 176, 226, 255 ],
+ 'LightSkyBlue2' => [ 164, 211, 238 ],
+ 'LightSkyBlue3' => [ 141, 182, 205 ],
+ 'LightSkyBlue4' => [ 96, 123, 139 ],
+ 'LightSteelBlue' => [ 176, 196, 222 ],
+ 'LightSteelBlue1' => [ 202, 225, 255 ],
+ 'LightSteelBlue2' => [ 188, 210, 238 ],
+ 'LightSteelBlue3' => [ 162, 181, 205 ],
+ 'LightSteelBlue4' => [ 110, 123, 139 ],
+ 'LightYellow' => [ 255, 255, 224 ],
+ 'LightYellow1' => [ 255, 255, 224 ],
+ 'LightYellow2' => [ 238, 238, 209 ],
+ 'LightYellow3' => [ 205, 205, 180 ],
+ 'LightYellow4' => [ 139, 139, 122 ],
+ 'MediumOrchid' => [ 186, 85, 211 ],
+ 'MediumOrchid1' => [ 224, 102, 255 ],
+ 'MediumOrchid2' => [ 209, 95, 238 ],
+ 'MediumOrchid3' => [ 180, 82, 205 ],
+ 'MediumOrchid4' => [ 122, 55, 139 ],
+ 'MediumPurple1' => [ 171, 130, 255 ],
+ 'MediumPurple2' => [ 159, 121, 238 ],
+ 'MediumPurple3' => [ 137, 104, 205 ],
+ 'MediumPurple4' => [ 93, 71, 139 ],
+ 'MistyRose' => [ 255, 228, 225 ],
+ 'MistyRose1' => [ 255, 228, 225 ],
+ 'MistyRose2' => [ 238, 213, 210 ],
+ 'MistyRose3' => [ 205, 183, 181 ],
+ 'MistyRose4' => [ 139, 125, 123 ],
+ 'NavajoWhite' => [ 255, 222, 173 ],
+ 'NavajoWhite1' => [ 255, 222, 173 ],
+ 'NavajoWhite2' => [ 238, 207, 161 ],
+ 'NavajoWhite3' => [ 205, 179, 139 ],
+ 'NavajoWhite4' => [ 139, 121, 94 ],
+ 'OliveDrab' => [ 107, 142, 35 ],
+ 'OliveDrab1' => [ 192, 255, 62 ],
+ 'OliveDrab2' => [ 179, 238, 58 ],
+ 'OliveDrab3' => [ 154, 205, 50 ],
+ 'OliveDrab4' => [ 105, 139, 34 ],
+ 'OrangeRed' => [ 255, 69, 0 ],
+ 'OrangeRed1' => [ 255, 69, 0 ],
+ 'OrangeRed2' => [ 238, 64, 0 ],
+ 'OrangeRed3' => [ 205, 55, 0 ],
+ 'OrangeRed4' => [ 139, 37, 0 ],
+ 'PaleGreen' => [ 152, 251, 152 ],
+ 'PaleTurquoise' => [ 175, 238, 238 ],
+ 'PaleTurquoise1' => [ 187, 255, 255 ],
+ 'PaleTurquoise2' => [ 174, 238, 238 ],
+ 'PaleTurquoise3' => [ 150, 205, 205 ],
+ 'PaleTurquoise4' => [ 102, 139, 139 ],
+ 'PaleVioletRed' => [ 219, 112, 147 ],
+ 'PaleVioletRed1' => [ 255, 130, 171 ],
+ 'PaleVioletRed2' => [ 238, 121, 159 ],
+ 'PaleVioletRed3' => [ 205, 104, 137 ],
+ 'PaleVioletRed4' => [ 139, 71, 93 ],
+ 'RosyBrown' => [ 188, 143, 143 ],
+ 'RosyBrown1' => [ 255, 193, 193 ],
+ 'RosyBrown2' => [ 238, 180, 180 ],
+ 'RosyBrown3' => [ 205, 155, 155 ],
+ 'RosyBrown4' => [ 139, 105, 105 ],
+ 'RoyalBlue1' => [ 72, 118, 255 ],
+ 'RoyalBlue2' => [ 67, 110, 238 ],
+ 'RoyalBlue3' => [ 58, 95, 205 ],
+ 'RoyalBlue4' => [ 39, 64, 139 ],
+ 'SeaGreen' => [ 46, 139, 87 ],
+ 'SeaGreen1' => [ 84, 255, 159 ],
+ 'SeaGreen2' => [ 78, 238, 148 ],
+ 'SeaGreen3' => [ 67, 205, 128 ],
+ 'SeaGreen4' => [ 46, 139, 87 ],
+ 'SkyBlue' => [ 135, 206, 235 ],
+ 'SkyBlue1' => [ 135, 206, 255 ],
+ 'SkyBlue2' => [ 126, 192, 238 ],
+ 'SkyBlue3' => [ 108, 166, 205 ],
+ 'SkyBlue4' => [ 74, 112, 139 ],
+ 'SlateBlue1' => [ 131, 111, 255 ],
+ 'SlateBlue2' => [ 122, 103, 238 ],
+ 'SlateBlue3' => [ 105, 89, 205 ],
+ 'SlateBlue4' => [ 71, 60, 139 ],
+ 'SlateGray' => [ 112, 128, 144 ],
+ 'SlateGray1' => [ 198, 226, 255 ],
+ 'SlateGray2' => [ 185, 211, 238 ],
+ 'SlateGray3' => [ 159, 182, 205 ],
+ 'SlateGray4' => [ 108, 123, 139 ],
+ 'SpringGreen' => [ 0, 255, 127 ],
+ 'SpringGreen1' => [ 0, 255, 127 ],
+ 'SpringGreen2' => [ 0, 238, 118 ],
+ 'SpringGreen3' => [ 0, 205, 102 ],
+ 'SpringGreen4' => [ 0, 139, 69 ],
+ 'SteelBlue' => [ 70, 130, 180 ],
+ 'SteelBlue1' => [ 99, 184, 255 ],
+ 'SteelBlue2' => [ 92, 172, 238 ],
+ 'SteelBlue3' => [ 79, 148, 205 ],
+ 'SteelBlue4' => [ 54, 100, 139 ],
+ 'VioletRed' => [ 208, 32, 144 ],
+ 'VioletRed1' => [ 255, 62, 150 ],
+ 'VioletRed2' => [ 238, 58, 140 ],
+ 'VioletRed3' => [ 205, 50, 120 ],
+ 'VioletRed4' => [ 139, 34, 82 ],
+ 'aquamarine' => [ 127, 255, 212 ],
+ 'aquamarine1' => [ 127, 255, 212 ],
+ 'aquamarine2' => [ 118, 238, 198 ],
+ 'aquamarine3' => [ 102, 205, 170 ],
+ 'aquamarine4' => [ 69, 139, 116 ],
+ 'azure' => [ 240, 255, 255 ],
+ 'azure1' => [ 240, 255, 255 ],
+ 'azure2' => [ 224, 238, 238 ],
+ 'azure3' => [ 193, 205, 205 ],
+ 'azure4' => [ 131, 139, 139 ],
+ 'bisque' => [ 255, 228, 196 ],
+ 'bisque1' => [ 255, 228, 196 ],
+ 'bisque2' => [ 238, 213, 183 ],
+ 'bisque3' => [ 205, 183, 158 ],
+ 'bisque4' => [ 139, 125, 107 ],
+ 'blue1' => [ 0, 0, 255 ],
+ 'blue2' => [ 0, 0, 238 ],
+ 'blue3' => [ 0, 0, 205 ],
+ 'blue4' => [ 0, 0, 139 ],
+ 'brown1' => [ 255, 64, 64 ],
+ 'brown2' => [ 238, 59, 59 ],
+ 'brown3' => [ 205, 51, 51 ],
+ 'brown4' => [ 139, 35, 35 ],
+ 'burlywood' => [ 222, 184, 135 ],
+ 'burlywood1' => [ 255, 211, 155 ],
+ 'burlywood2' => [ 238, 197, 145 ],
+ 'burlywood3' => [ 205, 170, 125 ],
+ 'burlywood4' => [ 139, 115, 85 ],
+ 'chartreuse' => [ 127, 255, 0 ],
+ 'chartreuse1' => [ 127, 255, 0 ],
+ 'chartreuse2' => [ 118, 238, 0 ],
+ 'chartreuse3' => [ 102, 205, 0 ],
+ 'chartreuse4' => [ 69, 139, 0 ],
+ 'chocolate' => [ 210, 105, 30 ],
+ 'coral' => [ 255, 127, 80 ],
+ 'coral1' => [ 255, 114, 86 ],
+ 'coral2' => [ 238, 106, 80 ],
+ 'coral3' => [ 205, 91, 69 ],
+ 'coral4' => [ 139, 62, 47 ],
+ 'cornsilk' => [ 255, 248, 220 ],
+ 'cornsilk1' => [ 255, 248, 220 ],
+ 'cornsilk2' => [ 238, 232, 205 ],
+ 'cornsilk3' => [ 205, 200, 177 ],
+ 'cornsilk4' => [ 139, 136, 120 ],
+ 'cyan' => [ 0, 255, 255 ],
+ 'cyan1' => [ 0, 255, 255 ],
+ 'cyan2' => [ 0, 238, 238 ],
+ 'cyan3' => [ 0, 205, 205 ],
+ 'cyan4' => [ 0, 139, 139 ],
+ 'firebrick' => [ 178, 34, 34 ],
+ 'firebrick1' => [ 255, 48, 48 ],
+ 'firebrick2' => [ 238, 44, 44 ],
+ 'firebrick3' => [ 205, 38, 38 ],
+ 'firebrick4' => [ 139, 26, 26 ],
+ 'gold' => [ 255, 215, 0 ],
+ 'gold1' => [ 255, 215, 0 ],
+ 'gold2' => [ 238, 201, 0 ],
+ 'gold3' => [ 205, 173, 0 ],
+ 'gold4' => [ 139, 117, 0 ],
+ 'goldenrod' => [ 218, 165, 32 ],
+ 'goldenrod1' => [ 255, 193, 37 ],
+ 'goldenrod2' => [ 238, 180, 34 ],
+ 'goldenrod3' => [ 205, 155, 29 ],
+ 'goldenrod4' => [ 139, 105, 20 ],
+ 'gray' => [ 190, 190, 190 ],
+ 'gray1' => [ 3, 3, 3 ],
+ 'gray2' => [ 5, 5, 5 ],
+ 'gray3' => [ 8, 8, 8 ],
+ 'gray4' => [ 10, 10, 10 ],
+ 'green1' => [ 0, 255, 0 ],
+ 'green2' => [ 0, 238, 0 ],
+ 'green3' => [ 0, 205, 0 ],
+ 'green4' => [ 0, 139, 0 ],
+ 'grey1' => [ 3, 3, 3 ],
+ 'grey2' => [ 5, 5, 5 ],
+ 'grey3' => [ 8, 8, 8 ],
+ 'grey4' => [ 10, 10, 10 ],
+ 'honeydew' => [ 240, 255, 240 ],
+ 'honeydew1' => [ 240, 255, 240 ],
+ 'honeydew2' => [ 224, 238, 224 ],
+ 'honeydew3' => [ 193, 205, 193 ],
+ 'honeydew4' => [ 131, 139, 131 ],
+ 'ivory' => [ 255, 255, 240 ],
+ 'ivory1' => [ 255, 255, 240 ],
+ 'ivory2' => [ 238, 238, 224 ],
+ 'ivory3' => [ 205, 205, 193 ],
+ 'ivory4' => [ 139, 139, 131 ],
+ 'khaki' => [ 240, 230, 140 ],
+ 'khaki1' => [ 255, 246, 143 ],
+ 'khaki2' => [ 238, 230, 133 ],
+ 'khaki3' => [ 205, 198, 115 ],
+ 'khaki4' => [ 139, 134, 78 ],
+ 'magenta' => [ 255, 0, 255 ],
+ 'magenta1' => [ 255, 0, 255 ],
+ 'magenta2' => [ 238, 0, 238 ],
+ 'magenta3' => [ 205, 0, 205 ],
+ 'magenta4' => [ 139, 0, 139 ],
+ 'maroon' => [ 176, 48, 96 ],
+ 'maroon1' => [ 255, 52, 179 ],
+ 'maroon2' => [ 238, 48, 167 ],
+ 'maroon3' => [ 205, 41, 144 ],
+ 'maroon4' => [ 139, 28, 98 ],
+ 'orange1' => [ 255, 165, 0 ],
+ 'orchid' => [ 218, 112, 214 ],
+ 'orchid1' => [ 255, 131, 250 ],
+ 'orchid2' => [ 238, 122, 233 ],
+ 'orchid3' => [ 205, 105, 201 ],
+ 'orchid4' => [ 139, 71, 137 ],
+ 'pink1' => [ 255, 181, 197 ],
+ 'pink2' => [ 238, 169, 184 ],
+ 'pink3' => [ 205, 145, 158 ],
+ 'pink4' => [ 139, 99, 108 ],
+ 'plum1' => [ 255, 187, 255 ],
+ 'plum2' => [ 238, 174, 238 ],
+ 'plum3' => [ 205, 150, 205 ],
+ 'plum4' => [ 139, 102, 139 ],
+ 'purple1' => [ 155, 48, 255 ],
+ 'purple2' => [ 145, 44, 238 ],
+ 'purple3' => [ 125, 38, 205 ],
+ 'purple4' => [ 85, 26, 139 ],
+ 'red1' => [ 255, 0, 0 ],
+ 'red2' => [ 238, 0, 0 ],
+ 'red3' => [ 205, 0, 0 ],
+ 'red4' => [ 139, 0, 0 ],
+ 'salmon' => [ 250, 128, 114 ],
+ 'salmon1' => [ 255, 140, 105 ],
+ 'salmon2' => [ 238, 130, 98 ],
+ 'salmon3' => [ 205, 112, 84 ],
+ 'salmon4' => [ 139, 76, 57 ],
+ 'seashell' => [ 255, 245, 238 ],
+ 'seashell1' => [ 255, 245, 238 ],
+ 'seashell2' => [ 238, 229, 222 ],
+ 'seashell3' => [ 205, 197, 191 ],
+ 'seashell4' => [ 139, 134, 130 ],
+ 'sienna' => [ 160, 82, 45 ],
+ 'sienna1' => [ 255, 130, 71 ],
+ 'sienna2' => [ 238, 121, 66 ],
+ 'sienna3' => [ 205, 104, 57 ],
+ 'sienna4' => [ 139, 71, 38 ],
+ 'snow' => [ 255, 250, 250 ],
+ 'snow1' => [ 255, 250, 250 ],
+ 'snow2' => [ 238, 233, 233 ],
+ 'snow3' => [ 205, 201, 201 ],
+ 'snow4' => [ 139, 137, 137 ],
+ 'tan' => [ 210, 180, 140 ],
+ 'tan1' => [ 255, 165, 79 ],
+ 'tan2' => [ 238, 154, 73 ],
+ 'tan3' => [ 205, 133, 63 ],
+ 'tan4' => [ 139, 90, 43 ],
+ 'thistle' => [ 216, 191, 216 ],
+ 'thistle1' => [ 255, 225, 255 ],
+ 'thistle2' => [ 238, 210, 238 ],
+ 'thistle3' => [ 205, 181, 205 ],
+ 'thistle4' => [ 139, 123, 139 ],
+ 'tomato' => [ 255, 99, 71 ],
+ 'tomato1' => [ 255, 99, 71 ],
+ 'tomato2' => [ 238, 92, 66 ],
+ 'tomato3' => [ 205, 79, 57 ],
+ 'tomato4' => [ 139, 54, 38 ],
+ 'turquoise1' => [ 0, 245, 255 ],
+ 'turquoise2' => [ 0, 229, 238 ],
+ 'turquoise3' => [ 0, 197, 205 ],
+ 'turquoise4' => [ 0, 134, 139 ],
+ 'wheat' => [ 245, 222, 179 ],
+ 'wheat1' => [ 255, 231, 186 ],
+ 'wheat2' => [ 238, 216, 174 ],
+ 'wheat3' => [ 205, 186, 150 ],
+ 'wheat4' => [ 139, 126, 102 ],
+ 'yellow1' => [ 255, 255, 0 ],
+ 'yellow2' => [ 238, 238, 0 ],
+ 'yellow3' => [ 205, 205, 0 ],
+ 'yellow4' => [ 139, 139, 0 ],
+ 'RoseQuartz' => [ 247, 202, 201 ], # https://www.w3schools.com/colors/colors_trends.asp
+ 'PeachEcho' => [ 247, 120, 107 ], # 2016
+ 'Serenity' => [ 145, 168, 208 ], # Spring
+ 'SnorkelBlue' => [ 3, 79, 132 ],
+ 'LimpetShell' => [ 152, 221, 222 ],
+ 'LilacGrey' => [ 152, 221, 222 ],
+ 'IcedCoffee' => [ 177, 143, 106 ],
+ 'Fiesta' => [ 221, 65, 50 ],
+ 'Buttercup' => [ 221, 65, 50 ],
+ 'GreenFlash' => [ 250, 224, 60 ],
+ 'Riverside' => [ 76, 106, 146 ], # Fall
+ 'AiryBlue' => [ 146, 182, 213 ],
+ 'Sharkskin' => [ 131, 132, 135 ],
+ 'AuroraRed' => [ 185, 58, 50 ],
+ 'WarmTaupe' => [ 175, 148, 131 ],
+ 'DustyCedar' => [ 173, 93, 93 ],
+ 'LushMeadow' => [ 0, 110, 81 ],
+ 'SpicyMustard' => [ 216, 174, 71 ],
+ "Potter'sClay" => [ 158, 70, 36 ],
+ 'Bodacious' => [ 183, 107, 163 ],
+
+
+
+);
+
+
+sub all_names { keys %store }
+sub name_taken { exists $store{$_[0]}}
+
+sub add {
+ my $name = shift;
+ my $val = shift;
+ return "Color name missing" unless defined $name and $name;
+ return "Color already exists" if exists $store{$name};
+ return "Need a Color value (ArrayRef to 3 Int < 256)" if ref $val ne 'ARRAY' or @$val != 3;
+ my $ret = Color->new(@$val);
+ return $ret unless ref $ret;
+ $store{$name} = $ret;
+}
+
+sub get {
+ my $name = shift;
+ @{$store{$name}}[0..2] if exists $store{$name}
+}
+
+
+1;
+
+__END__
+
+my %RGB = (
+ white => [0xFF,0xFF,0xFF],
+ lgray => [0xBF,0xBF,0xBF],
+ gray => [0x7F,0x7F,0x7F],
+ dgray => [0x3F,0x3F,0x3F],
+ black => [0x00,0x00,0x00],
+ lblue => [0x00,0x00,0xFF],
+ blue => [0x00,0x00,0xBF],
+ dblue => [0x00,0x00,0x7F],
+ gold => [0xFF,0xD7,0x00],
+ lyellow => [0xFF,0xFF,0x00],
+ yellow => [0xBF,0xBF,0x00],
+ dyellow => [0x7F,0x7F,0x00],
+ lgreen => [0x00,0xFF,0x00],
+ green => [0x00,0xBF,0x00],
+ dgreen => [0x00,0x7F,0x00],
+ lred => [0xFF,0x00,0x00],
+ red => [0xBF,0x00,0x00],
+ dred => [0x7F,0x00,0x00],
+ lpurple => [0xFF,0x00,0xFF],
+ purple => [0xBF,0x00,0xBF],
+ dpurple => [0x7F,0x00,0x7F],
+ lorange => [0xFF,0xB7,0x00],
+ orange => [0xFF,0x7F,0x00],
+ pink => [0xFF,0xB7,0xC1],
+ dpink => [0xFF,0x69,0xB4],
+ marine => [0x7F,0x7F,0xFF],
+ cyan => [0x00,0xFF,0xFF],
+ lbrown => [0xD2,0xB4,0x8C],
+ dbrown => [0xA5,0x2A,0x2A],
+);
diff --git a/lib/Chart/Color/Scheme.pm b/lib/Chart/Color/Scheme.pm
new file mode 100644
index 0000000..00e7cd9
--- /dev/null
+++ b/lib/Chart/Color/Scheme.pm
@@ -0,0 +1,105 @@
+
+# Chart::Color::Store : expandable store of color sets
+
+use v5.12;
+
+package Chart::Color::Scheme;
+
+use use Chart::Color::Named;
+
+my %keys = ( background => '',
+ misc => '',
+ text => '',
+ x_label => '',
+ x_label2 => '',
+ y_label => '',
+ y_label2 => '',
+ x_grid_lines => '',
+ y_grid_lines => '',
+ dataset => []);
+
+my %scheme = (
+ 'default' => {
+ background => 'white',
+ misc => 'black',
+ text => 'black',
+ x_label => 'black',
+ x_label2 => 'black',
+ y_label => 'black',
+ y_label2 => 'black',
+ x_grid_lines => 'black',
+ y_grid_lines => 'black',
+ dataset => [ qw (red green blue purple peach orange mauve olive pink light_purple light_blue
+ plum yellow turquoise light_green brown HotPink PaleGreen1 DarkBlue BlueViolet orange2
+ chocolate1 LightGreen pink light_purple light_blue plum yellow turquoise light_green brown pink
+ PaleGreen2 MediumPurple PeachPuff1 orange3 chocolate2 olive pink light_purple light_blue plum
+ yellow turquoise light_green brown DarkOrange PaleGreen3 SlateBlue BlueViolet PeachPuff2 orange4
+ chocolate3 LightGreen pink light_purple light_blue plum yellow turquoise light_green brown snow1
+ honeydew3 SkyBlue1 cyan3 DarkOliveGreen1 IndianRed3 orange1 LightPink3 MediumPurple1 snow3
+ LavenderBlush1 SkyBlue3 DarkSlateGray1 DarkOliveGreen3 sienna1 orange3 PaleVioletRed1 MediumPurple3
+ seashell1 LavenderBlush3 LightSkyBlue1 DarkSlateGray3 khaki1 sienna3 DarkOrange1 PaleVioletRed3
+ thistle1 seashell3 MistyRose1 LightSkyBlue3 aquamarine1 khaki3 burlywood1 DarkOrange3 maroon1
+ thistle3 AntiqueWhite1 MistyRose3 SlateGray1 aquamarine3 LightGoldenrod1 burlywood3 coral1 maroon3
+ AntiqueWhite3 azure1 SlateGray3 DarkSeaGreen1 LightGoldenrod3 wheat1 coral3 VioletRed1 bisque1
+ azure3 LightSteelBlue1 DarkSeaGreen3 LightYellow1 wheat3 tomato1 VioletRed3 bisque3 SlateBlue1
+ LightSteelBlue3 SeaGreen1 LightYellow3 tan1 tomato3 magenta1 PeachPuff1 SlateBlue3 LightBlue1
+ SeaGreen3 yellow1 tan3 OrangeRed1 magenta3 PeachPuff3 RoyalBlue1 LightBlue3 PaleGreen1 yellow3
+ chocolate1 OrangeRed3 orchid1 NavajoWhite1 RoyalBlue3 LightCyan1 PaleGreen3 gold1 chocolate3
+ red1 orchid3 NavajoWhite3 blue1 LightCyan3 SpringGreen1 gold3 firebrick1 red3 plum1 LemonChiffon1
+ blue3 PaleTurquoise1 SpringGreen3 goldenrod1 firebrick3 DeepPink1 plum3 LemonChiffon3 DodgerBlue1
+ PaleTurquoise3 green1 goldenrod3 brown1 DeepPink3 MediumOrchid1 cornsilk1 DodgerBlue3 CadetBlue1
+ green3 DarkGoldenrod1 brown3 HotPink1 MediumOrchid3 cornsilk3 SteelBlue1 CadetBlue3 chartreuse1
+ DarkGoldenrod3 salmon1 HotPink3 DarkOrchid1 ivory1 SteelBlue3 turquoise1 chartreuse3 RosyBrown1
+ salmon3 pink1 DarkOrchid3 ivory3 DeepSkyBlue1 turquoise3 OliveDrab1 RosyBrown3 LightSalmon1 pink3
+ purple1 honeydew1 DeepSkyBlue3 cyan1 OliveDrab3 IndianRed1 LightSalmon3 LightPink1 purple3 honeydew2
+ DeepSkyBlue4 cyan2 OliveDrab4 IndianRed2 LightSalmon4 LightPink2 purple4 snow2 honeydew4 SkyBlue2
+ cyan4 DarkOliveGreen2 IndianRed4 orange2 LightPink4 MediumPurple2 snow4 LavenderBlush2 SkyBlue4
+ DarkSlateGray2 DarkOliveGreen4 sienna2 orange4 PaleVioletRed2 MediumPurple4 seashell2 LavenderBlush4
+ LightSkyBlue2 DarkSlateGray4 khaki2 sienna4 DarkOrange2 PaleVioletRed4 thistle2 seashell4 MistyRose2
+ LightSkyBlue4 aquamarine2 khaki4 burlywood2 DarkOrange4 maroon2 thistle4 AntiqueWhite2 MistyRose4
+ SlateGray2 aquamarine4 LightGoldenrod2 burlywood4 coral2 maroon4 AntiqueWhite4 azure2 SlateGray4
+ DarkSeaGreen2 LightGoldenrod4 wheat2 coral4 VioletRed2 bisque2 azure4 LightSteelBlue2 DarkSeaGreen4
+ LightYellow2 wheat4 tomato2 VioletRed4 bisque4 SlateBlue2 LightSteelBlue4 SeaGreen2 LightYellow4 tan2
+ tomato4 magenta2 PeachPuff2 SlateBlue4 LightBlue2 SeaGreen4 yellow2 tan4 OrangeRed2 magenta4 PeachPuff4
+ RoyalBlue2 LightBlue4 PaleGreen2 yellow4 chocolate2 OrangeRed4 orchid2 NavajoWhite2 RoyalBlue4
+ LightCyan2 PaleGreen4 gold2 chocolate4 red2 orchid4 NavajoWhite4 blue2 LightCyan4 SpringGreen2 gold4
+ firebrick2 red4 plum2 LemonChiffon2 blue4 PaleTurquoise2 SpringGreen4 goldenrod2 firebrick4 DeepPink2
+ plum4 LemonChiffon4 DodgerBlue2 PaleTurquoise4 green2 goldenrod4 brown2 DeepPink4 MediumOrchid2
+ cornsilk2 DodgerBlue4 CadetBlue2 green4 DarkGoldenrod2 brown4 HotPink2 MediumOrchid4 cornsilk4
+ SteelBlue2 CadetBlue4 chartreuse2 DarkGoldenrod4 salmon2 HotPink4 DarkOrchid2 ivory2 SteelBlue4
+ turquoise2 chartreuse4 RosyBrown2 salmon4 pink2 DarkOrchid4 ivory4 DeepSkyBlue2 turquoise4 OliveDrab2
+ RosyBrown4 LightSalmon2 pink4 purple2)] },
+);
+
+
+
+
+sub all_names { keys %set }
+sub name_taken { exists %set{$_[0]} }
+
+sub add {
+ my $name = shift;
+ my $my_scheme = shift;
+ return "Color scheme name missing" unless defined $name and $name;
+ return "Color scheme already exists" if exists $scheme{$name};
+ return "Color scheme has to be a Hash" if ref $val ne 'HASH';
+ for my $k (keys %$val){
+ return "$k is not a valid key of an color set" unless exists $scheme{'default'}{$k}
+ }
+ for my $k (keys %{$scheme{'default'}}){
+ $my_set->{$k} = $scheme{'default'}{$k} unless exists $my_scheme->{$k};
+ }
+
+## check all color, whole data set
+# return "Need a Color value (ArrayRef to 3 Int < 256)" if ref $val ne 'ARRAY' or @$val != 3;
+ my $ret = Color->new(@$val);
+ return $ret unless ref $ret;
+ $scheme{$name} = $my_set;
+}
+
+sub get { $scheme{$_[0]} if exists $scheme{$_[0]} }
+
+
+1;
+
+
diff --git a/lib/Chart/Composite.pm b/lib/Chart/Composite.pm
index 556b916..8b68e12 100644
--- a/lib/Chart/Composite.pm
+++ b/lib/Chart/Composite.pm
@@ -1,32 +1,14 @@
-## @file
-# Implementation of Chart::Composite
-#
-# written by
-# @author david bonner (dbonner@cs.bu.edu)
-#
-# maintained by the
-# @author Chart Group at Geodetic Fundamental Station Wettzell (Chart@fs.wettzell.de)
-# @date 2015-03-01
-# @version 2.4.10
-#
-#---------------------------------------------------------------------
-# History:
-#----------
+# charts composed of several types
-## @class Chart::Composite
-# Composite class derived from class Base.\n
-# This class provides all functions which are specific to
-# composite charts
+use v5.12;
package Chart::Composite;
+our @ISA = qw(Chart::Base);
our $VERSION = 2.400.5;
use Chart::Base;
use GD;
use Carp;
-use strict;
-
-@Chart::Composite::ISA = qw(Chart::Base);
#>>>>>>>>>>>>>>>>>>>>>>>>>>#
# public methods go here #
diff --git a/lib/Chart/Constants.pm b/lib/Chart/Constants.pm
index 8e013f2..e7085d6 100644
--- a/lib/Chart/Constants.pm
+++ b/lib/Chart/Constants.pm
@@ -1,9 +1,11 @@
+
+# set up initial constant values
+
use v5.12;
package Chart::Constants;
our $VERSION = 2.400.5;
-# set up initial constant values
use constant PI => 4 * atan2( 1, 1 );
diff --git a/lib/Chart/Direction.pm b/lib/Chart/Direction.pm
index 39b4e2a..c9fde69 100644
--- a/lib/Chart/Direction.pm
+++ b/lib/Chart/Direction.pm
@@ -1,32 +1,17 @@
-## @file
-# Implementation of Chart::Direction
-#
-# written by
-# @author Chart Group at Geodetic Fundamental Station Wettzell (Chart@fs.wettzell.de)
-# @date 2015-03-01
-# @version 2.4.10
-#
-# @section Chart::Direction
-# Implements a circular oriented chart like rotating vectors
-#
+# circular oriented chart like rotating vectors
-## @class Chart::Direction
-# @brief Direction class derived class for Chart to implement direction
-# charts
+use v5.12;
package Chart::Direction;
+our @ISA = qw(Chart::Base);
our $VERSION = 2.400.5;
use Chart::Base;
use GD;
use Carp;
-
-use strict;
use POSIX;
-@Chart::Direction::ISA = qw(Chart::Base);
-
#>>>>>>>>>>>>>>>>>>>>>>>>>>#
# public methods go here #
#<<<<<<<<<<<<<<<<<<<<<<<<<<#
@@ -737,7 +722,7 @@ sub _draw_data
$color = $self->_color_role_to_index( 'dataset' . ( $j / 2 - 0.5 ) );
}
-##### $color = $self->_color_role_to_index('dataset'.(1)); #####################
+##### $color = $self->_color_role_to_index('dataset'.(1)); #####################
for $i ( 0 .. $self->{'num_datapoints'} - 1 )
{
diff --git a/lib/Chart/ErrorBars.pm b/lib/Chart/ErrorBars.pm
index 6724bb7..f0be52a 100644
--- a/lib/Chart/ErrorBars.pm
+++ b/lib/Chart/ErrorBars.pm
@@ -1,31 +1,16 @@
-## @file
-# Implementation of Chart::ErrorBars
-#
-# written by
-# @author david bonner (dbonner@cs.bu.edu)
-#
-# maintained by the
-# @author Chart Group at Geodetic Fundamental Station Wettzell (Chart@fs.wettzell.de)
-# @date 2015-03-01
-# @version 2.4.10
-#
+
+# chart type: error bar - vertical bars
+# which represent errors or standard deviations
+
+use v5.12;
package Chart::ErrorBars;
-our $VERSION = 2.400.5;
+our @ISA = qw(Chart::Base);
+our $VERSION = '2.400.5';
+
use Chart::Base;
use GD;
use Carp;
-use strict;
-
-@Chart::ErrorBars::ISA = qw(Chart::Base);
-
-## @class Chart::ErrorBars
-# ErrorBars class derived from class Base.
-#
-# This class provides all functions which are specific to
-# pointes having carrying vertical bars which represent
-# errors or standard deviations
-#
#>>>>>>>>>>>>>>>>>>>>>>>>>>#
# public methods go here #
@@ -40,8 +25,7 @@ use strict;
#
# Overwrites Base function
#
-sub _draw_data
-{
+sub _draw_data {
my $self = shift;
my $data = $self->{'dataref'};
my $misccolor = $self->_color_role_to_index('misc');
diff --git a/lib/Chart/HorizontalBars.pm b/lib/Chart/HorizontalBars.pm
index 9112279..1566c40 100644
--- a/lib/Chart/HorizontalBars.pm
+++ b/lib/Chart/HorizontalBars.pm
@@ -1,26 +1,13 @@
-## @file
-# Implementation of Chart::HorizontalBars
-#
-# maintained and written by the
-# @author Chart Group at Geodetic Fundamental Station Wettzell (Chart@fs.wettzell.de)
-# @date 2015-03-01
-# @version 2.4.10
-## @class Chart::HorizontalBars
-# HorizontalBars class derived from class Base.
-#
-# This class provides all functions which are specific to
-# horizontal bars
-#
+use v5.12;
+
package Chart::HorizontalBars;
-our $VERSION = 2.400.5;
+our @ISA = qw(Chart::Base);
+our $VERSION = '2.400.5';
use Chart::Base;
use GD;
use Carp;
-use strict;
-
-@Chart::HorizontalBars::ISA = qw(Chart::Base);
#>>>>>>>>>>>>>>>>>>>>>>>>>>#
# public methods go here #
diff --git a/lib/Chart/Lines.pm b/lib/Chart/Lines.pm
index c92fdd9..59f19bc 100644
--- a/lib/Chart/Lines.pm
+++ b/lib/Chart/Lines.pm
@@ -1,30 +1,15 @@
-## @file
-# Implementation of Chart::Lines
-#
-# written by david bonner
-# dbonner@cs.bu.edu
-#
-# maintained by the Chart Group at Geodetic Fundamental Station Wettzell
-# Chart@fs.wettzell.de
-# @author Chart Group (Chart@fs.wettzell.de)
-# @date 2015-03-01
-# @version 2.4.10
-
-## @class Chart::Lines
-# Lines class derived from class Base.
-#
-# This class provides all functions which are specific to
-# lines
-#
+
+# chart type with lines
+
+use v5.12;
+
package Chart::Lines;
+our @ISA = qw(Chart::Base);
our $VERSION = 2.400.5;
use Chart::Base;
use GD;
use Carp;
-use strict;
-
-@Chart::Lines::ISA = qw(Chart::Base);
#>>>>>>>>>>>>>>>>>>>>>>>>>>#
# public methods go here #
diff --git a/lib/Chart/LinesPoints.pm b/lib/Chart/LinesPoints.pm
index 2b6df69..279077b 100644
--- a/lib/Chart/LinesPoints.pm
+++ b/lib/Chart/LinesPoints.pm
@@ -1,31 +1,20 @@
-## @file
-# Implementation of Chart::LinesPoints
#
-# written by
-# @author david bonner (dbonner@cs.bu.edu)
-#
-# maintained by the
-# @author Chart Group at Geodetic Fundamental Station Wettzell (Chart@fs.wettzell.de)
-# @date 2015-03-01
-# @version 2.4.10
+# line charts (plots)
+# LinesPoints class connect the given x-/y-values by straight lines
+# and the x-/y-values are plotted by points.
#
-## @class Chart::LinesPoints
-# LinesPoints class connect the given x-/y-values by straight lines and the x-/y-values are plotted by points.
-#
-# This class provides all functions which are specific to
-# lines
-#
+use v5.12;
package Chart::LinesPoints;
+our @ISA = qw(Chart::Base);
our $VERSION = 2.400.5;
use Chart::Base;
use GD;
use Carp;
-use strict;
-@Chart::LinesPoints::ISA = qw(Chart::Base);
+
#>>>>>>>>>>>>>>>>>>>>>>>>>>#
# public methods go here #
diff --git a/lib/Chart/Mountain.pm b/lib/Chart/Mountain.pm
index 338f37b..8be6a61 100644
--- a/lib/Chart/Mountain.pm
+++ b/lib/Chart/Mountain.pm
@@ -1,29 +1,5 @@
-## @file
-# Implementation of Chart::Mountain
-#
-# written by david bonner
-# dbonner@cs.bu.edu
-#
-# maintained by
-# @author Chart Group at Geodetic Fundamental Station Wettzell (Chart@fs.wettzell.de)
-# @date 2015-03-01
-# @version 2.4.10
-#
-# Updated for
-# compatibility with
-# changes to Chart::Base
-# by peter clark
-# ninjaz@webexpress.com
-#
-# Copyright 1998, 1999 by James F. Miner.
-# All rights reserved.
-# This program is free software; you can redistribute it
-# and/or modify it under the same terms as Perl itself.
-#
-## @class Chart::Mountain
-# @brief Mountain class derived class for Chart to implement mountain type of plots
-#
+
# Some Mountain chart details:
#
# The effective y data value for a given x point and dataset
@@ -44,15 +20,15 @@
# of its area, not just a line color. So the legend shou a square
# of the color and pattern for each dataset.
+use v5.12;
+
package Chart::Mountain;
+our @ISA = qw(Chart::Base);
our $VERSION = 2.400.5;
use Chart::Base;
use GD;
use Carp;
-use strict;
-
-@Chart::Mountain::ISA = qw ( Chart::Base );
#===================#
# private methods #
diff --git a/lib/Chart/Pareto.pm b/lib/Chart/Pareto.pm
index 032979f..b95d30d 100644
--- a/lib/Chart/Pareto.pm
+++ b/lib/Chart/Pareto.pm
@@ -1,24 +1,12 @@
-## @file
-# Implementation of Chart::Pareto
-#
-# written and maintained by
-# @author Chart Group at Geodetic Fundamental Station Wettzell (Chart@fs.wettzell.de)
-# @date 2015-03-01
-# @version 2.4.10
-#
-
-## @class Chart::Pareto
-# @brief Pareto class derived class for Chart to implement
-#
+use v5.12;
+
package Chart::Pareto;
+our @ISA = qw(Chart::Base);
our $VERSION = 2.400.5;
use Chart::Base;
use GD;
use Carp;
-use strict;
-
-@Chart::Pareto::ISA = qw(Chart::Base);
#>>>>>>>>>>>>>>>>>>>>>>>>>>#
# public methods go here #
diff --git a/lib/Chart/Pie.pm b/lib/Chart/Pie.pm
index 15cb441..06008c7 100644
--- a/lib/Chart/Pie.pm
+++ b/lib/Chart/Pie.pm
@@ -1,25 +1,17 @@
-## @file
-# Implementation of Chart::Pie
-#
-# written and maintained by
-# @author Chart Group at Geodetic Fundamental Station Wettzell (Chart@fs.wettzell.de)
-# @date 2015-03-01
-# @version 2.4.10
-#
-## @class Chart::Pie
-# @brief Pie class derived class for Chart to implement pies
-#
+# pie and doughnut (ring) charts
+
+use v5.12;
+
package Chart::Pie;
-our $VERSION = 2.400.5;
+our @ISA = qw(Chart::Base);
+our $VERSION = '2.400.5';
-use Chart::Base;
-use GD;
use Carp;
+use GD;
use Chart::Constants;
-use strict;
+use Chart::Base ;
-@Chart::Pie::ISA = qw(Chart::Base);
#>>>>>>>>>>>>>>>>>>>>>>>>>>#
# public methods go here #
@@ -470,7 +462,7 @@ sub _draw_data
# # Draw Point
# # reset the brush for points
# my $brush = $self->_prepare_brush($color, 'point',
- # $self->{'pointStyle' . '0'});
+ # $self->{'pointStyle' . '0'});
# $self->{'gd_obj'}->setBrush($brush);
#
# # draw the point
diff --git a/lib/Chart/Points.pm b/lib/Chart/Points.pm
index a8d2784..cddc5fe 100644
--- a/lib/Chart/Points.pm
+++ b/lib/Chart/Points.pm
@@ -1,30 +1,16 @@
-## @file
-# Implementation of Chart::Points
-#
-# written by
-# @author david bonner (dbonner@cs.bu.edu)
-#
-# maintained by the
-# @author Chart Group at Geodetic Fundamental Station Wettzell (Chart@fs.wettzell.de)
-# @date 2015-03-01
-# @version 2.4.10
-#
-
-## @class Chart::Points
-# Points class derived from class Base.
-#
-# This class provides all functions which are specific to
-# points
-#
+
+# xy charts (plots) with points (dots)
+
+use v5.12;
+
package Chart::Points;
-our $VERSION = 2.400.5;
+our @ISA = qw(Chart::Base);
+our $VERSION = '2.400.5';
-use Chart::Base;
-use GD;
use Carp;
-use strict;
+use GD;
+use Chart::Base;
-@Chart::Points::ISA = qw(Chart::Base);
#>>>>>>>>>>>>>>>>>>>>>>>>>>#
# public methods go here #
@@ -160,5 +146,4 @@ sub _draw_data
}
-## be a good module and return 1
-1;
+1; # be a good module and return 1
diff --git a/lib/Chart/Split.pm b/lib/Chart/Split.pm
index 347f845..f13f940 100644
--- a/lib/Chart/Split.pm
+++ b/lib/Chart/Split.pm
@@ -13,15 +13,16 @@
# This class provides all functions which are specific to
# splitted plots
#
+
+use v5.12;
+
package Chart::Split;
-our $VERSION = 2.400.5;
+our @ISA = qw(Chart::Base);
+our $VERSION = '2.400.5';
use Chart::Base;
use GD;
use Carp;
-use strict;
-
-@Chart::Split::ISA = qw(Chart::Base);
#>>>>>>>>>>>>>>>>>>>>>>>>>>#
# public methods go here #
diff --git a/lib/Chart/StackedBars.pm b/lib/Chart/StackedBars.pm
index d19043e..eee6eb3 100644
--- a/lib/Chart/StackedBars.pm
+++ b/lib/Chart/StackedBars.pm
@@ -1,29 +1,12 @@
-## @file
-# Implementation of Chart::StackedBars
-#
-# written by
-# @author david bonner (dbonner@cs.bu.edu)
-#
-# maintained by the
-# @author Chart Group at Geodetic Fundamental Station Wettzell (Chart@fs.wettzell.de)
-# @date 2015-03-01
-# @version 2.4.10
-#
+use v5.12;
-## @class Chart::StackedBars
-# StackedBars class derived from class Base.
-#
-# This class provides all functions which are specific to
-# stacked bars
package Chart::StackedBars;
+our @ISA = qw(Chart::Base);
our $VERSION = 2.400.5;
use Chart::Base;
use GD;
use Carp;
-use strict;
-
-@Chart::StackedBars::ISA = qw(Chart::Base);
#>>>>>>>>>>>>>>>>>>>>>>>>>>#
# public methods go here #
diff --git a/t/Humidity.t b/t/Humidity.t
index 25ec3ff..077ec3e 100644
--- a/t/Humidity.t
+++ b/t/Humidity.t
@@ -8,6 +8,8 @@ BEGIN { unshift @INC, 'lib', '../lib'}
use strict;
use Chart::Lines;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -228,12 +230,12 @@ $graphic->set( 'y_label' => $einheit );
if ( $graphic->can('gif') )
{
- my $wettgif = "samples/" . $gif_name . ".gif";
+ my $wettgif = "$samples/" . $gif_name . ".gif";
$graphic->gif($wettgif);
}
elsif ( $graphic->can('png') )
{
- my $wettgif = "samples/" . $gif_name . ".png";
+ my $wettgif = "$samples/" . $gif_name . ".png";
$graphic->png($wettgif);
}
diff --git a/t/Math_1_over_x.t b/t/Math_1_over_x.t
index 7768c2b..afe5f56 100644
--- a/t/Math_1_over_x.t
+++ b/t/Math_1_over_x.t
@@ -8,6 +8,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use strict;
use Chart::Lines;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -85,12 +87,12 @@ $graphic->set( 'y_label' => 'f = 1/x' );
if ( $graphic->can('gif') )
{
- my $picture_file = "samples/Math_1_over_x.gif";
+ my $picture_file = "$samples/Math_1_over_x.gif";
$graphic->gif($picture_file);
}
if ( $graphic->can('png') )
{
- my $picture_file = "samples/Math_1_over_x.png";
+ my $picture_file = "$samples/Math_1_over_x.png";
$graphic->png($picture_file);
}
diff --git a/t/bars.t b/t/bars.t
index 9aed1bd..1e05be6 100644
--- a/t/bars.t
+++ b/t/bars.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Bars;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -44,7 +46,7 @@ $g->add_dataset( 50000, 70000, 20200, 80000.8, 40000 );
);
$g->set(%hash);
-$g->png("samples/bars.png");
+$g->png("$samples/bars.png");
print "ok 1\n";
diff --git a/t/bars_10.t b/t/bars_10.t
index a0ed9da..f47f1bd 100644
--- a/t/bars_10.t
+++ b/t/bars_10.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Bars;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -36,7 +38,7 @@ $g->add_dataset( 0, 0, 0, 0, 0 );
$g->set(%hash);
-$g->png("samples/bars_10.png");
+$g->png("$samples/bars_10.png");
print "ok 1\n";
diff --git a/t/bars_2.t b/t/bars_2.t
index e8fc6ed..5327513 100644
--- a/t/bars_2.t
+++ b/t/bars_2.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Bars;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -46,7 +48,7 @@ $g->add_dataset( 17, 5, 7, 2, 6 );
$g->set(%hash);
-$g->png("samples/bars_2.png");
+$g->png("$samples/bars_2.png");
print "ok 1\n";
diff --git a/t/bars_3.t b/t/bars_3.t
index 4c9ecc6..dc5c9ce 100644
--- a/t/bars_3.t
+++ b/t/bars_3.t
@@ -4,6 +4,8 @@ BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Bars;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
$g = Chart::Bars->new( 500, 500 );
@@ -29,7 +31,7 @@ $g->add_dataset( -2.4, 3.4, 1.9, 1.2, -1.1, -2.9 );
);
$g->set(%hash);
-$g->png("samples/bars_3.png");
+$g->png("$samples/bars_3.png");
print "ok 1\n";
diff --git a/t/bars_4.t b/t/bars_4.t
index a3ffa11..63f6561 100644
--- a/t/bars_4.t
+++ b/t/bars_4.t
@@ -6,6 +6,8 @@ BEGIN { unshift @INC, 'lib', '../lib'}
use strict;
use Chart::Bars;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -13,7 +15,7 @@ my @x_values = (); # x axis
my @y_values = ();
my $graphic;
-my $picture_file = "samples/bars_4.png";
+my $picture_file = "$samples/bars_4.png";
my $min_y = -5; # max. y-values
my $max_y = 5;
diff --git a/t/bars_5.t b/t/bars_5.t
index 2d33c31..c09c72e 100644
--- a/t/bars_5.t
+++ b/t/bars_5.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use strict;
use Chart::Bars;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -37,7 +39,7 @@ $g->add_dataset(@data);
);
$g->set(%hash);
-$g->png("samples/bars_5.png");
+$g->png("$samples/bars_5.png");
print "ok 1\n";
exit(0);
diff --git a/t/bars_6.t b/t/bars_6.t
index cd10d3f..1d4db59 100644
--- a/t/bars_6.t
+++ b/t/bars_6.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use strict;
use Chart::Bars;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -42,7 +44,7 @@ $g->set(
# max_val => 9000,
);
-$g->png("samples/bars_6.png");
+$g->png("$samples/bars_6.png");
print "ok 1\n";
exit(0);
diff --git a/t/bars_7.t b/t/bars_7.t
index 4bb4cbf..4681c48 100644
--- a/t/bars_7.t
+++ b/t/bars_7.t
@@ -4,6 +4,8 @@ BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Bars;
use strict;
use POSIX;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
my $a;
@@ -44,7 +46,7 @@ $g->set(
x_label => 'Date',
);
-$g->png("samples/bars_7.png");
+$g->png("$samples/bars_7.png");
print "ok 1\n";
exit(0);
diff --git a/t/bars_8.t b/t/bars_8.t
index a81ab59..27f34d4 100644
--- a/t/bars_8.t
+++ b/t/bars_8.t
@@ -4,6 +4,8 @@ BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Bars;
use strict;
use POSIX;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
my $a;
$a = 10**(-30);
@@ -48,7 +50,7 @@ $g->set(
x_label => 'Date',
);
-$g->png("samples/bars_8.png");
+$g->png("$samples/bars_8.png");
print "ok 1\n";
exit(0);
diff --git a/t/bars_9.t b/t/bars_9.t
index f907237..f0e0374 100644
--- a/t/bars_9.t
+++ b/t/bars_9.t
@@ -4,6 +4,8 @@ BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Bars;
use strict;
use POSIX;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -40,7 +42,7 @@ $g->set(
x_label => 'Date',
);
-$g->png("samples/bars_9.png");
+$g->png("$samples/bars_9.png");
print "ok 1\n";
exit(0);
diff --git a/t/composite.t b/t/composite.t
index 885ad71..60509e9 100644
--- a/t/composite.t
+++ b/t/composite.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Composite;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -31,7 +33,7 @@ $g->set(
}
);
$g->set( 'brush_size2' => 1 );
-$g->png("samples/composite.png");
+$g->png("$samples/composite.png");
print "ok 1\n";
diff --git a/t/composite_1.t b/t/composite_1.t
index 7f52840..39a1a2f 100644
--- a/t/composite_1.t
+++ b/t/composite_1.t
@@ -2,13 +2,15 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Composite;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
my $obj = Chart::Composite->new( 600, 500 );
my @legend_ary;
my ( $legend, @zeile );
my @all_aryref;
-open( OUT, ">samples/composite_1.png" ) or die "cannot write file samples/composite_1.png\n";
+open( OUT, ">$samples/composite_1.png" ) or die "cannot write file $samples/composite_1.png\n";
my $i = 0;
my $e = 0;
diff --git a/t/composite_2.t b/t/composite_2.t
index 59c02d1..f82ebb4 100644
--- a/t/composite_2.t
+++ b/t/composite_2.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use strict;
use Chart::Composite;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -59,7 +61,7 @@ $g->set(
$g->set( 'f_y_tick' => sub { return ( $_[0] . '(' . sprintf( "%.1f", $_[0] / 18.0182 ) . ')' ) } );
-$g->png("samples/composite_2.png");
+$g->png("$samples/composite_2.png");
print "ok 1\n";
diff --git a/t/composite_3.t b/t/composite_3.t
index f7b5ec1..93baab2 100644
--- a/t/composite_3.t
+++ b/t/composite_3.t
@@ -3,13 +3,15 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use strict;
use Chart::Composite; #(type is one of: Points, Lines, Bars, LinesPoints, Composite, StackedBars, Mountain)
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
my $obj = Chart::Composite->new( 800, 600 ); #Breite, Höhe
my @legend_ary;
my ( $legend, @zeile );
my @all_aryref;
-open( OUT, ">samples/composite_3.png" ) or die "kann Datei nicht schreiben\n";
+open( OUT, ">$samples/composite_3.png" ) or die "kann Datei nicht schreiben\n";
my $i = 0;
my $e = 0;
diff --git a/t/composite_4.t b/t/composite_4.t
index b381ded..eea7533 100644
--- a/t/composite_4.t
+++ b/t/composite_4.t
@@ -1,7 +1,9 @@
-#!usr/bin/perl -w
+#!/usr/bin/perl -w
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Composite;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -19,7 +21,7 @@ $g->set(
'include_zero' => 'true',
);
-$g->png("samples/composite_4.png");
+$g->png("$samples/composite_4.png");
print "ok 1\n";
diff --git a/t/composite_5.t b/t/composite_5.t
index 7dbc959..e8b6e1d 100644
--- a/t/composite_5.t
+++ b/t/composite_5.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Composite;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -18,7 +20,7 @@ $g->set(
'composite_info' => [ [ 'Bars', [ 1 .. 3 ] ], [ 'LinesPoints', [4] ] ]
);
-$g->png("samples/composite_5.png");
+$g->png("$samples/composite_5.png");
print "ok 1\n";
diff --git a/t/composite_6.t b/t/composite_6.t
index d834341..075be26 100644
--- a/t/composite_6.t
+++ b/t/composite_6.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Composite;
use strict;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -34,7 +36,7 @@ my %chart_settings = (
);
$chart->set(%chart_settings);
-$chart->png("samples/composite_6.png");
+$chart->png("$samples/composite_6.png");
print "ok 1\n";
diff --git a/t/composite_7.t b/t/composite_7.t
index 631c474..c54928f 100644
--- a/t/composite_7.t
+++ b/t/composite_7.t
@@ -6,6 +6,8 @@ use Chart::Lines;
use Chart::Points;
use Chart::LinesPoints;
use strict;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -47,7 +49,7 @@ $g->add_dataset( @x[@s] );
$g->add_dataset( @y[@s] );
$g->add_dataset(@x2);
$g->set(%hash);
-$g->jpeg("samples/composite_7.jpg");
+$g->jpeg("$samples/composite_7.jpg");
print "ok 1\n";
diff --git a/t/composite_8.t b/t/composite_8.t
index 27c4cc2..a5040ca 100644
--- a/t/composite_8.t
+++ b/t/composite_8.t
@@ -11,6 +11,8 @@ use Chart::Lines;
use Chart::Points;
use Chart::LinesPoints;
use strict;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -53,7 +55,7 @@ $g->add_dataset( @y[@s] );
$g->add_dataset(@x2);
$g->set(%hash);
$g->set( xy_plot => 1 );
-$g->jpeg("samples/composite_8.jpg");
+$g->jpeg("$samples/composite_8.jpg");
print "ok 1\n";
diff --git a/t/composite_f.t b/t/composite_f.t
index 96f7817..276919f 100644
--- a/t/composite_f.t
+++ b/t/composite_f.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Composite;
use strict;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -24,7 +26,7 @@ $g->set( 'legend_example_height0..1' => '10' );
$g->set( 'legend_example_height2' => '3' );
$g->set( 'f_y_tick' => \&multiply );
$g->set( 'f_x_tick' => \&int_quadrat );
-$g->png("samples/composite_f.png");
+$g->png("$samples/composite_f.png");
print "ok 1\n";
diff --git a/t/direction_1.t b/t/direction_1.t
index 9f76e2e..cf9001b 100644
--- a/t/direction_1.t
+++ b/t/direction_1.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Direction;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -23,7 +25,7 @@ $g->set(
# 'polar' => 'true',
);
-$g->png("samples/direction_1.png");
+$g->png("$samples/direction_1.png");
print "ok 1\n";
diff --git a/t/direction_2.t b/t/direction_2.t
index 5cd828f..5e69174 100644
--- a/t/direction_2.t
+++ b/t/direction_2.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Direction;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -21,7 +23,7 @@ $g->set(
);
-$g->png("samples/direction_2.png");
+$g->png("$samples/direction_2.png");
print "ok 1\n";
diff --git a/t/direction_3.t b/t/direction_3.t
index 59f126c..70048c7 100644
--- a/t/direction_3.t
+++ b/t/direction_3.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Direction;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -28,7 +30,7 @@ $g->set(
'grey_background' => 'false',
);
-$g->png("samples/direction_3.png");
+$g->png("$samples/direction_3.png");
print "ok 1\n";
diff --git a/t/direction_4.t b/t/direction_4.t
index 888d35e..d58e64b 100644
--- a/t/direction_4.t
+++ b/t/direction_4.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Direction;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -31,7 +33,7 @@ $g->set(
'grey_background' => 'false',
);
-$g->png("samples/direction_4.png");
+$g->png("$samples/direction_4.png");
print "ok 1\n";
diff --git a/t/error_1.t b/t/error_1.t
index ad8f3c7..99f0662 100644
--- a/t/error_1.t
+++ b/t/error_1.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::ErrorBars;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -24,7 +26,7 @@ $g->set(
);
-$g->png("samples/error_1.png");
+$g->png("$samples/error_1.png");
print "ok 1\n";
diff --git a/t/error_2.t b/t/error_2.t
index f8adb27..41019f6 100644
--- a/t/error_2.t
+++ b/t/error_2.t
@@ -1,7 +1,9 @@
-#!usr/bin/perl -w
+#!/usr/bin/perl -w
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::ErrorBars;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -24,7 +26,7 @@ $g->set(
'custom_x_ticks' => [ 0, 1 ],
);
-$g->png("samples/error_2.png");
+$g->png("$samples/error_2.png");
print "ok 1\n";
diff --git a/t/f_ticks.t b/t/f_ticks.t
index c7d2ce8..6d48a83 100644
--- a/t/f_ticks.t
+++ b/t/f_ticks.t
@@ -9,6 +9,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use strict;
use Chart::Points;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -72,12 +74,12 @@ $graphic->set( 'f_y_tick' => \&formatter );
if ( $graphic->can('gif') )
{
- my $picture_file = "samples/f_ticks.gif";
+ my $picture_file = "$samples/f_ticks.gif";
$graphic->gif($picture_file);
}
if ( $graphic->can('png') )
{
- my $picture_file = "samples/f_ticks.png";
+ my $picture_file = "$samples/f_ticks.png";
$graphic->png($picture_file);
}
diff --git a/t/f_ticks_1.t b/t/f_ticks_1.t
index 931cec3..d4220f5 100644
--- a/t/f_ticks_1.t
+++ b/t/f_ticks_1.t
@@ -7,6 +7,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use strict;
use Chart::LinesPoints;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -93,7 +95,7 @@ $graphic->set( 'f_x_tick' => \&convert_to_real_x );
if ( $graphic->can('png') )
{
- my $picture_file = "samples/f_ticks_1.png";
+ my $picture_file = "$samples/f_ticks_1.png";
$graphic->png($picture_file);
}
diff --git a/t/hbars_1.t b/t/hbars_1.t
index 060ce58..634f66e 100644
--- a/t/hbars_1.t
+++ b/t/hbars_1.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::HorizontalBars;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -40,7 +42,7 @@ $g->add_dataset( 5, 4, 2, 5, 3, 6, 1, 4, 5, 4, 2, 5 );
$g->set(%hash);
-$g->png("samples/hbars_1.png");
+$g->png("$samples/hbars_1.png");
print "ok 1\n";
diff --git a/t/hbars_2.t b/t/hbars_2.t
index 0c533d4..de37789 100644
--- a/t/hbars_2.t
+++ b/t/hbars_2.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::HorizontalBars;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -34,7 +36,7 @@ $g->add_dataset( 7, -5, -3, 4, 7 );
$g->set(%hash);
-$g->png("samples/hbars_2.png");
+$g->png("$samples/hbars_2.png");
print "ok 1\n";
diff --git a/t/hbars_3.t b/t/hbars_3.t
index 69eb879..5bf7d94 100644
--- a/t/hbars_3.t
+++ b/t/hbars_3.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::HorizontalBars;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -23,7 +25,7 @@ $g->add_dataset( -2, -10, -3, -8, -3 );
$g->set(%hash);
-$g->png("samples/hbars_3.png");
+$g->png("$samples/hbars_3.png");
print "ok 1\n";
diff --git a/t/hbars_4.t b/t/hbars_4.t
index 0f5b5cb..691a6f7 100644
--- a/t/hbars_4.t
+++ b/t/hbars_4.t
@@ -1,7 +1,9 @@
-#!usr/bin/perl -w
+#!/usr/bin/perl -w
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::HorizontalBars;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -19,7 +21,7 @@ $g->add_dataset( 2, 10, 3, 8, 3 );
);
$g->set(%hash);
-$g->png("samples/hbars_4.png");
+$g->png("$samples/hbars_4.png");
print "ok 1\n";
exit(0);
diff --git a/t/lines.t b/t/lines.t
index cfd023e..844b5ed 100644
--- a/t/lines.t
+++ b/t/lines.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Lines;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -22,7 +24,7 @@ $g->add_dataset( 5, 7, 2.3, 10, 12, );
}
);
$g->set(%hash);
-$g->png("samples/lines.png");
+$g->png("$samples/lines.png");
print "ok 1\n";
#
diff --git a/t/lines_1.t b/t/lines_1.t
index 9caaa5b..aa47b0e 100644
--- a/t/lines_1.t
+++ b/t/lines_1.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Lines;
use strict;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
my $g;
print "1..1\n";
@@ -30,7 +32,7 @@ $g->set( 'y_label2' => 'y label 2' );
$g->set( 'y_grid_lines' => 'true' );
$g->set( 'legend' => 'bottom' );
-$g->png("samples/lines_1.png");
+$g->png("$samples/lines_1.png");
print "ok 1\n";
diff --git a/t/lines_2.t b/t/lines_2.t
index 6d83a1e..7d9b827 100644
--- a/t/lines_2.t
+++ b/t/lines_2.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Lines;
use strict;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
my $g;
print "1..1\n";
@@ -31,7 +33,7 @@ $g->set( 'y_label2' => 'y label 2' );
$g->set( 'y_grid_lines' => 'true' );
$g->set( 'legend' => 'left' );
-$g->png("samples/lines_2.png");
+$g->png("$samples/lines_2.png");
print "ok 1\n";
diff --git a/t/lines_3.t b/t/lines_3.t
index 4304224..a1a10a1 100644
--- a/t/lines_3.t
+++ b/t/lines_3.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Lines;
use strict;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
my $g;
print "1..1\n";
@@ -30,7 +32,7 @@ $g->set( 'y_label2' => 'y label 2' );
$g->set( 'y_grid_lines' => 'true' );
$g->set( 'legend' => 'right' );
-$g->png("samples/lines_3.png");
+$g->png("$samples/lines_3.png");
print "ok 1\n";
diff --git a/t/lines_4.t b/t/lines_4.t
index 0724ba8..6b2a63a 100644
--- a/t/lines_4.t
+++ b/t/lines_4.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Lines;
use strict;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
my $g;
print "1..1\n";
@@ -30,7 +32,7 @@ $g->set( 'y_label2' => 'y label 2' );
$g->set( 'y_grid_lines' => 'true' );
$g->set( 'legend' => 'top' );
-$g->png("samples/lines_4.png");
+$g->png("$samples/lines_4.png");
print "ok 1\n";
diff --git a/t/lines_5.t b/t/lines_5.t
index 9c99b88..9a61ba3 100644
--- a/t/lines_5.t
+++ b/t/lines_5.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Lines;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
$g = Chart::Lines->new( 600, 300 );
@@ -41,7 +43,7 @@ $g->add_dataset(@y2_values);
$g->set(%hash);
-$g->png("samples/lines_5.png");
+$g->png("$samples/lines_5.png");
sub formatter
{
diff --git a/t/lines_6.t b/t/lines_6.t
index 6a0c749..4ee42db 100644
--- a/t/lines_6.t
+++ b/t/lines_6.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Lines;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
$g = Chart::Lines->new();
@@ -33,7 +35,7 @@ $g->add_dataset( 7, -5, -3, 4, 7 );
$g->set(%hash);
-$g->png("samples/lines_6.png");
+$g->png("$samples/lines_6.png");
print "ok 1\n";
diff --git a/t/lines_7.t b/t/lines_7.t
index 5868284..01d1800 100644
--- a/t/lines_7.t
+++ b/t/lines_7.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Lines;
use strict;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
my $g;
print "1..1\n";
@@ -22,7 +24,7 @@ $g->set( 'legend' => 'bottom' );
$g->set( 'precision' => '0' );
$g->set( 'include_zero' => 'true' );
-$g->png("samples/lines_7.png");
+$g->png("$samples/lines_7.png");
print "ok 1\n";
diff --git a/t/lines_8.t b/t/lines_8.t
index 25055c5..199c8b5 100644
--- a/t/lines_8.t
+++ b/t/lines_8.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Lines;
use strict;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
my $g;
print "1..1\n";
@@ -20,7 +22,7 @@ $g->set( 'include_zero' => 'true' );
$g->set( 'stepline' => 'true' );
$g->set( 'stepline_mode' => 'begin' );
-$g->png("samples/lines_8.png");
+$g->png("$samples/lines_8.png");
print "ok 1\n";
diff --git a/t/lines_9.t b/t/lines_9.t
index b081e60..126fdd0 100644
--- a/t/lines_9.t
+++ b/t/lines_9.t
@@ -4,6 +4,8 @@ BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Lines;
use Chart::LinesPoints;
use strict;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
my $g;
print "1..1\n";
@@ -20,7 +22,7 @@ $g->set( 'legend' => 'none' );
$g->set( 'xy_plot' => 1 );
$g->set( 'x_ticks' => 'vertical' );
-$g->png("samples/lines_9.png");
+$g->png("$samples/lines_9.png");
$g = Chart::Lines->new;
$g->add_dataset( 10, 20, 30, 40, 50, 60 );
@@ -36,7 +38,7 @@ $g->set(
xlabels => \@labels,
xrange => [ 0, 100 ]
);
-$g->png("samples/lines_9b.png");
+$g->png("$samples/lines_9b.png");
print "ok 1\n";
diff --git a/t/linespoints.t b/t/linespoints.t
index cb83602..10434a0 100644
--- a/t/linespoints.t
+++ b/t/linespoints.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::LinesPoints;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -14,7 +16,7 @@ $g->add_dataset( 5, 7, 2, 7, 9 );
$g->set( 'title' => 'Lines and Points Chart' );
$g->set( 'legend' => 'bottom' );
-$g->png("samples/linespoints.png");
+$g->png("$samples/linespoints.png");
print "ok 1\n";
diff --git a/t/linespoints_1.t b/t/linespoints_1.t
index 8ee53bc..62a7e11 100644
--- a/t/linespoints_1.t
+++ b/t/linespoints_1.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::LinesPoints;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -22,7 +24,7 @@ $g->set( 'grid_lines' => 'true' );
$g->set( 'grey_background' => 'false' );
$g->set( 'legend' => 'bottom' );
-$g->png("samples/linespoints_1.png");
+$g->png("$samples/linespoints_1.png");
print "ok 1\n";
diff --git a/t/linespoints_2.t b/t/linespoints_2.t
index 4e8714c..0757e12 100644
--- a/t/linespoints_2.t
+++ b/t/linespoints_2.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::LinesPoints;
use strict;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -45,7 +47,7 @@ $g->add_dataset(@data2);
);
$g->set(%hash);
-$g->png("samples/linespoints_2.png");
+$g->png("$samples/linespoints_2.png");
print "ok 1\n";
exit(0);
diff --git a/t/linespoints_3.t b/t/linespoints_3.t
index 50fcafc..5ca3ab3 100644
--- a/t/linespoints_3.t
+++ b/t/linespoints_3.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::LinesPoints;
use strict;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -33,7 +35,7 @@ $g->add_dataset(@data4);
);
$g->set(%hash);
-$g->png("samples/linespoints_3.png");
+$g->png("$samples/linespoints_3.png");
#just a trick, to let the y scale start at the biggest point:
#initiate with negativ values, remove the minus sign!
diff --git a/t/linespoints_4.t b/t/linespoints_4.t
index fac41a6..a31e7bd 100644
--- a/t/linespoints_4.t
+++ b/t/linespoints_4.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use strict;
use Chart::LinesPoints;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -41,6 +43,6 @@ $g->set( 'brush_size' => '4' );
# $g-> set ('skip_x_ticks' => $skip_x);
# $g-> set ('integer_ticks_only' => 'true');
-$g->png("samples/linespoints_4.png");
+$g->png("$samples/linespoints_4.png");
print "ok 1\n\n";
diff --git a/t/linespoints_5.t b/t/linespoints_5.t
index 665b810..26ca12b 100644
--- a/t/linespoints_5.t
+++ b/t/linespoints_5.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use strict;
use Chart::Composite;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -63,6 +65,6 @@ $g->set( 'brush_size' => '4' );
# $g-> set ('skip_x_ticks' => $skip_x);
-$g->png("samples/linespoints_5.png");
+$g->png("$samples/linespoints_5.png");
print "ok 1\n\n";
diff --git a/t/linespoints_6.t b/t/linespoints_6.t
index 548f7b8..3f85514 100644
--- a/t/linespoints_6.t
+++ b/t/linespoints_6.t
@@ -4,6 +4,8 @@ BEGIN { unshift @INC, 'lib', '../lib'}
use strict;
use Chart::LinesPoints;
use Chart::Lines;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -430,6 +432,6 @@ $g->set( 'pt_size' => '20' );
$g->set( 'brush_size' => '4' );
$g->set( 'skip_x_ticks' => '50' );
-$g->png("samples/linespoints_6.png");
+$g->png("$samples/linespoints_6.png");
print "ok 1\n\n";
diff --git a/t/linespoints_7.t b/t/linespoints_7.t
index b08ed69..2386052 100644
--- a/t/linespoints_7.t
+++ b/t/linespoints_7.t
@@ -4,6 +4,8 @@ BEGIN { unshift @INC, 'lib', '../lib'}
use strict;
use Chart::LinesPoints;
use Chart::Lines;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -37,6 +39,6 @@ $g->set( 'pt_size' => '10' );
$g->set( 'brush_size' => '3' );
$g->set( 'stepline' => 'true' );
-$g->png("samples/linespoints_7.png");
+$g->png("$samples/linespoints_7.png");
print "ok 1\n\n";
diff --git a/t/mapbars.t b/t/mapbars.t
index 5718bf8..f1eefee 100644
--- a/t/mapbars.t
+++ b/t/mapbars.t
@@ -1,9 +1,12 @@
+#!/usr/bin/perl -w
BEGIN { unshift @INC, 'lib', '../lib'}
use strict;
use Chart::Bars;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
-my $png_name = 'samples/mapbars.png';
+my $png_name = "$samples/mapbars.png";
my @legend_keys = ( "Actual ", "Goal" );
my $Graph = new Chart::Bars( 600, 400 );
diff --git a/t/mapcomp.t b/t/mapcomp.t
index 5f69d1e..c48ef5d 100644
--- a/t/mapcomp.t
+++ b/t/mapcomp.t
@@ -1,8 +1,12 @@
+#!/usr/bin/perl -w
+
BEGIN { unshift @INC, 'lib', '../lib'}
use strict;
use Chart::Composite;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
-my $png_name = 'samples/mapcomp.png';
+my $png_name = "$samples/mapcomp.png";
my @legend_keys = ( "Actual ", "Goal" );
#
diff --git a/t/mountain.t b/t/mountain.t
index 064635f..82b290c 100644
--- a/t/mountain.t
+++ b/t/mountain.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Mountain;
use File::Spec;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..2\n";
@@ -47,7 +49,7 @@ my @opts = (
foreach my $i ( 1 .. @opts - 1 )
{
- my $newpath = File::Spec->catfile( File::Spec->curdir, 'samples', "mountain-$i.png" );
+ my $newpath = File::Spec->catfile( $samples, "mountain-$i.png" );
my $opts = $opts[$i];
my $g = new Chart::Mountain();
$g->set(%$opts);
diff --git a/t/mountain_2.t b/t/mountain_2.t
index d0514c3..fe92d22 100644
--- a/t/mountain_2.t
+++ b/t/mountain_2.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Mountain;
use File::Spec;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..2\n";
@@ -53,7 +55,7 @@ my @opts = (
foreach my $i ( 1 .. @opts - 1 )
{
- my $newpath = File::Spec->catfile( File::Spec->curdir, 'samples', "mountain_2-$i.png" );
+ my $newpath = File::Spec->catfile( $samples, "mountain_2-$i.png" );
my $opts = $opts[$i];
my $g = new Chart::Mountain();
$g->set(%$opts);
diff --git a/t/mountain_3.t b/t/mountain_3.t
index d725755..7d88008 100644
--- a/t/mountain_3.t
+++ b/t/mountain_3.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Mountain;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -76,7 +78,7 @@ $obj->set(
'grey_background' => 0,
);
-$obj->png( 'samples/mountain_3.png', \@data );
+$obj->png( "$samples/mountain_3.png", \@data );
print "ok 1\n";
exit(0);
diff --git a/t/mountain_4.t b/t/mountain_4.t
index a58652c..9b4075a 100644
--- a/t/mountain_4.t
+++ b/t/mountain_4.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Mountain;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -48,7 +50,7 @@ $obj->set(
'title_font' => ( GD::Font->Giant )
);
-$obj->png( 'samples/mountain_4.png', \@data );
+$obj->png( "$samples/mountain_4.png", \@data );
print "ok 1\n";
exit(0);
diff --git a/t/pareto_1.t b/t/pareto_1.t
index 0155151..a973012 100644
--- a/t/pareto_1.t
+++ b/t/pareto_1.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Pareto;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -31,7 +33,7 @@ $g->add_dataset( 2500, 1000, 250, 700, 100, 610, 20 );
);
$g->set(%hash);
-$g->png("samples/pareto_1.png");
+$g->png("$samples/pareto_1.png");
print "ok 1\n";
diff --git a/t/pareto_2.t b/t/pareto_2.t
index 7057d96..92ba80d 100644
--- a/t/pareto_2.t
+++ b/t/pareto_2.t
@@ -1,6 +1,9 @@
+#!/usr/bin/perl -w
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Pareto;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -37,7 +40,7 @@ $g->add_dataset( 37, 15, 9, 4, 3.5, 2.1, 1.2, 1.5, 6.2, 16 );
);
$g->set(%hash);
-$g->png("samples/pareto_2.png");
+$g->png("$samples/pareto_2.png");
print "ok 1\n";
diff --git a/t/pareto_3.t b/t/pareto_3.t
index 498cafb..f5c84dc 100644
--- a/t/pareto_3.t
+++ b/t/pareto_3.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Pareto;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -31,7 +33,7 @@ $g->add_dataset( 3000, 1600, 1500, 400, 100, 20, 5 );
);
$g->set(%hash);
-$g->png("samples/pareto_3.png");
+$g->png("$samples/pareto_3.png");
print "ok 1\n";
diff --git a/t/pie_1.t b/t/pie_1.t
index a629307..64cb9b1 100644
--- a/t/pie_1.t
+++ b/t/pie_1.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Pie;
use strict;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -29,7 +31,7 @@ $g->set(
);
$g->set( 'legend_lines' => 'true' );
-$g->png("samples/pie_1.png");
+$g->png("$samples/pie_1.png");
print "ok 1\n";
exit(0);
diff --git a/t/pie_10.t b/t/pie_10.t
index 9d4055f..75c1994 100644
--- a/t/pie_10.t
+++ b/t/pie_10.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Pie;
use strict;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -36,7 +38,7 @@ $g->set( 'legend' => 'right' );
$g->set( 'grey_background' => 'false' );
$g->set( 'legend_lines' => 'true' );
-$g->png("samples/pie_10.png");
+$g->png("$samples/pie_10.png");
print "ok 1\n";
exit(0);
diff --git a/t/pie_11.t b/t/pie_11.t
index b637c6b..3917f5a 100644
--- a/t/pie_11.t
+++ b/t/pie_11.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Pie;
use strict;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -17,7 +19,7 @@ $g->set( 'legend' => 'bottom' );
$g->set( 'grey_background' => 'true' );
$g->set( 'legend_lines' => 'true' );
-$g->png("samples/pie_11.png");
+$g->png("$samples/pie_11.png");
print "ok 1\n";
exit(0);
diff --git a/t/pie_2.t b/t/pie_2.t
index fba2c05..d5d3277 100644
--- a/t/pie_2.t
+++ b/t/pie_2.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Pie;
use strict;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
my $g;
print "1..1\n";
@@ -19,7 +21,7 @@ $g->set( 'grey_background' => 'false' );
$g->set( 'colors' => { 'title' => 'red' } );
$g->set( 'legend_lines' => 'true' );
-$g->png("samples/pie_2.png");
+$g->png("$samples/pie_2.png");
print "ok 1\n";
exit(0);
diff --git a/t/pie_3.t b/t/pie_3.t
index 89bb936..f5e3d00 100644
--- a/t/pie_3.t
+++ b/t/pie_3.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Pie;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -33,7 +35,7 @@ $g->add_dataset( 12000, 20000, 13000, 15000, 9000, 11000 );
$g->set(%opt);
-$g->png("samples/pie_3.png");
+$g->png("$samples/pie_3.png");
print "ok 1\n";
exit(0);
diff --git a/t/pie_4.t b/t/pie_4.t
index ec52d5d..9da0f0e 100644
--- a/t/pie_4.t
+++ b/t/pie_4.t
@@ -4,6 +4,8 @@ BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Pie;
use GD;
use strict;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -22,7 +24,7 @@ $g->set( 'legend_font' => gdSmallFont );
$g->set( 'title_font' => gdGiantFont );
$g->set( 'legend_lines' => 'false' );
-$g->png("samples/pie_4.png");
+$g->png("$samples/pie_4.png");
print "ok 1\n";
exit(0);
diff --git a/t/pie_5.t b/t/pie_5.t
index f93739a..0702bf2 100644
--- a/t/pie_5.t
+++ b/t/pie_5.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Pie;
use strict;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -26,7 +28,7 @@ $g->set(
}
);
-$g->png("samples/pie_5.png");
+$g->png("$samples/pie_5.png");
print "ok 1\n";
exit(0);
diff --git a/t/pie_6.t b/t/pie_6.t
index f94409e..9dd7fd4 100644
--- a/t/pie_6.t
+++ b/t/pie_6.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Pie;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -25,7 +27,7 @@ $g->add_dataset( 90, 0, 1, 216, 0 );
$g->set(%opt);
-$g->png("samples/pie_6.png");
+$g->png("$samples/pie_6.png");
print "ok 1\n";
exit(0);
diff --git a/t/pie_7.t b/t/pie_7.t
index 1b835e9..d43647a 100644
--- a/t/pie_7.t
+++ b/t/pie_7.t
@@ -4,6 +4,8 @@ BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Pie;
use GD;
use strict;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -20,7 +22,7 @@ $g->set( 'x_label' => '' );
$g->set( 'ring' => 0.1 );
$g->set( 'colors' => { 'background' => 'grey' } );
-$g->png("samples/pie_7.png");
+$g->png("$samples/pie_7.png");
print "ok 1\n";
exit(0);
diff --git a/t/pie_8.t b/t/pie_8.t
index e898a40..bd49acb 100644
--- a/t/pie_8.t
+++ b/t/pie_8.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Pie;
use strict;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -28,7 +30,7 @@ $g->set(
}
);
-$g->png("samples/pie_8.png");
+$g->png("$samples/pie_8.png");
print "ok 1\n";
exit(0);
diff --git a/t/pie_9.t b/t/pie_9.t
index 84ed527..3b7d665 100644
--- a/t/pie_9.t
+++ b/t/pie_9.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Pie;
use strict;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -18,7 +20,7 @@ $g->set( 'legend' => 'bottom' );
$g->set( 'grey_background' => 'false' );
$g->set( 'legend_lines' => 'false' );
-$g->png("samples/pie_9.png");
+$g->png("$samples/pie_9.png");
print "ok 1\n";
exit(0);
diff --git a/t/points.t b/t/points.t
index f832b7b..f57a02b 100644
--- a/t/points.t
+++ b/t/points.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Points;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -22,7 +24,7 @@ $g->add_dataset( 3, 4, 9 );
$g->add_dataset( 8, 6, 0 );
$g->add_dataset( 5, 7, 2 );
-$g->png("samples/points.png");
+$g->png("$samples/points.png");
print "ok 1\n";
diff --git a/t/points_100.t b/t/points_100.t
index 7ee714e..478bcb7 100644
--- a/t/points_100.t
+++ b/t/points_100.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Points;
use strict;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
my $g;
@@ -25,7 +27,7 @@ $g->set( 'title' => 'Points Chart with 100 Points' );
$g->set( 'skip_x_ticks' => 10 );
#$g->set ('skip_int_ticks'=> 10);
-$g->png("samples/points_100.png");
+$g->png("$samples/points_100.png");
print "ok 1\n";
diff --git a/t/points_2.t b/t/points_2.t
index 7dcef35..09d1abe 100644
--- a/t/points_2.t
+++ b/t/points_2.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Points;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -27,7 +29,7 @@ $g->add_dataset( 0, 0, 0, 0, 0, 0, 0 );
$g->set(@hash);
-$g->png("samples/points_2.png");
+$g->png("$samples/points_2.png");
print "ok 1\n";
diff --git a/t/points_3.t b/t/points_3.t
index 000d0f8..ec06071 100644
--- a/t/points_3.t
+++ b/t/points_3.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Points;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -24,7 +26,7 @@ $g->add_dataset( -3, 0, 8, 4, 2, 1, 0 );
$g->set(@hash);
-$g->png("samples/points_3.png");
+$g->png("$samples/points_3.png");
print "ok 1\n";
diff --git a/t/points_4.t b/t/points_4.t
index ccda2d2..8e71e1f 100644
--- a/t/points_4.t
+++ b/t/points_4.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Points;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -15,7 +17,7 @@ $g = Chart::Points->new();
'brush_size' => 10, # 10 points diameter
# 'brushStyle' => 'FilledCircle',
- # 'brushStyle' => 'circle',
+ # 'brushStyle' => 'circle',
# 'brushStyle' => 'donut',
# 'brushStyle' => 'OpenCircle',
# 'brushStyle' => 'fatPlus',
@@ -44,7 +46,7 @@ $g->add_dataset( 3, 4, 9 );
$g->add_dataset( 8, 6, 0 );
$g->add_dataset( 5, 7, 2 );
-$g->png("samples/points_4.png");
+$g->png("$samples/points_4.png");
print "ok 1\n";
diff --git a/t/points_5.t b/t/points_5.t
index 1d7a60b..9493b7e 100644
--- a/t/points_5.t
+++ b/t/points_5.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Points;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -15,7 +17,7 @@ $g = Chart::Points->new();
'brush_size' => 18, # 10 points diameter
# 'brushStyle' => 'FilledCircle',
- # 'brushStyle' => 'circle',
+ # 'brushStyle' => 'circle',
# 'brushStyle' => 'donut',
# 'brushStyle' => 'OpenCircle',
# 'brushStyle' => 'fatPlus',
@@ -72,7 +74,7 @@ $g->add_dataset( 14, 14, 14 );
$g->set( 'legend_labels' => \@labels );
-$g->png("samples/points_5.png");
+$g->png("$samples/points_5.png");
print "ok 1\n";
diff --git a/t/scalarImage.t b/t/scalarImage.t
index 97dfa57..cace193 100644
--- a/t/scalarImage.t
+++ b/t/scalarImage.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Lines;
use strict;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
# bytewise comparision of scalar
sub imgCompare
@@ -66,7 +68,7 @@ $g->set( 'y_label2' => 'y label 2' );
$g->set( 'y_grid_lines' => 'true' );
$g->set( 'legend' => 'bottom' );
-my $FileName = "samples/scalarImage.png";
+my $FileName = "$samples/scalarImage.png";
$g->png($FileName);
my $dataref = $g->get_data();
diff --git a/t/split_1.t b/t/split_1.t
index b160f39..4a00593 100644
--- a/t/split_1.t
+++ b/t/split_1.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Split;
use strict;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
my ( $x, $y, @x, @y, %hash );
@@ -32,7 +34,7 @@ $g->add_dataset(@y);
);
$g->set(%hash);
-$g->png("samples/split_1.png");
+$g->png("$samples/split_1.png");
print "ok 1\n";
exit(0);
diff --git a/t/split_2.t b/t/split_2.t
index eb58de1..e290b20 100644
--- a/t/split_2.t
+++ b/t/split_2.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::Split;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
$g = Chart::Split->new( 500, 500 );
@@ -33,7 +35,7 @@ $g->add_dataset(@y2);
'legend' => 'bottom',
);
$g->set(%options);
-$g->png("samples/split_2.png");
+$g->png("$samples/split_2.png");
print "ok 1\n";
exit(0);
diff --git a/t/stackedbars.t b/t/stackedbars.t
index 43271ef..0ac7ee7 100644
--- a/t/stackedbars.t
+++ b/t/stackedbars.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::StackedBars;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -17,7 +19,7 @@ $g->set(
'grey_background' => 'false',
);
-$g->png("samples/stackedbars.png");
+$g->png("$samples/stackedbars.png");
print "ok 1\n";
diff --git a/t/stackedbars_2.t b/t/stackedbars_2.t
index 938fb92..0f23f36 100644
--- a/t/stackedbars_2.t
+++ b/t/stackedbars_2.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use strict;
use Chart::StackedBars;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -47,7 +49,7 @@ $g->set(
}
);
-$g->png("samples/stackedbars_2.png");
+$g->png("$samples/stackedbars_2.png");
print "ok 1\n";
diff --git a/t/stackedbars_3.t b/t/stackedbars_3.t
index 06de5e0..1ab8209 100644
--- a/t/stackedbars_3.t
+++ b/t/stackedbars_3.t
@@ -3,6 +3,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use strict;
use Chart::StackedBars;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -36,7 +38,7 @@ $g->set(
}
);
-$g->png("samples/stackedbars_3.png");
+$g->png("$samples/stackedbars_3.png");
print "ok 1\n";
diff --git a/t/stackedbars_4.t b/t/stackedbars_4.t
index 183525d..9843a5a 100644
--- a/t/stackedbars_4.t
+++ b/t/stackedbars_4.t
@@ -2,6 +2,8 @@
BEGIN { unshift @INC, 'lib', '../lib'}
use Chart::StackedBars;
+use File::Temp 0.19;
+my $samples = File::Temp->newdir();
print "1..1\n";
@@ -43,7 +45,7 @@ $g->set(
}
);
-$g->png("samples/stackedbars_4.png");
+$g->png("$samples/stackedbars_4.png");
print "ok 1\n";