lichtkind / Chart

a series of charting modules
https://metacpan.org/pod/Chart
5 stars 4 forks source link

Documentation #6

Open Tux opened 1 year ago

Tux commented 1 year ago

I really like the simplicity and usefullness of this collection, but I had a hard time getting it the way I wanted, because of missing documentation. The test files in the distribution were really helpful, but that is not really user-friendly after installation.

use Chart::Points;
my $ch = Chart::Points->new (800, 400);
my @L  = ("unthreaded 1", "unthreaded 2", "threaded 1", "threaded 2");
$ch->set (
    pt_size             => 4,
    legend              => "top",
    legend_labels       => \@L,
    title               => "Issue 21360",
    x_label             => "perl version 5.X.0",
    y_label             => "duration (s)",
    colors              => {
        title           => "blue4",
        background      => [ 240, 240, 240 ],
        dataset0        => [ 191,   0,   0 ],
        dataset1        => [ 127,   0,   0 ],
        dataset2        => [   0, 191,   0 ],
        dataset3        => [   0, 127,   0 ],
        },
    grey_background     => 0,
    );
$ch->png ("x21360.png", [\@l, \@a, \@b, \@A, \@B ]);

Was what I ended up with, where I was most confused about having to use dataset2 instead of e.g. $L[2].

I tried to summerize what I found in the t files:

scalar attributes
--------------------------------------------------
angle_interval
arrow
f_x_tick
f_y_tick
graph_border
grid_lines
imagemap
include_zero
integer_ticks_only
interval
interval_ticks
label_font
label_values
legend
legend_example_height
legend_example_height0..1
legend_example_height0..2
legend_example_height0..3
legend_example_height2
legend_example_height3
legend_example_height4..8
legend_example_height4..9
legend_example_size
legend_font
legend_label_values
legend_lines
line
max_val
max_val1
max_val2
max_x_ticks
max_y_ticks
min_val
min_val1
min_val_2
min_val2
min_y_ticks
pairs
png_border
point
precision
pt_size
ring
same_error
same_y_axes
skip_int_ticks
skip_x_ticks
sort
space_bars
spaced_bars
start
stepline
stepline_mode
sub_title
sub_title_font
text_space
tick_label_font
tick_len
title
title_font
transparent
type_style
x_grid_lines
x_label
x_ticks
xy_plot
y_axes
y_grid_lines
y_label
y_label2
y_ticks

array attributes
--------------------------------------------------
composite_info
custom_x_ticks
legend_labels
patterns
xlabels
xrange

color attributes
--------------------------------------------------
grey_background
colors
    background
    dataset0
    dataset1
    dataset2
    dataset3
    dataset4
    ..
    dataset9
    grid_lines
    misc
    text
    title
    x_grid_lines
    x_label
    y2_grid_lines
    y_grid_lines
    y_label
    y_label2

brush attributes
--------------------------------------------------
brush_size
brush_size1
brush_size2
brushStyle
brushStyles
    dataset0
    dataset1
    dataset2
    dataset3
    dataset4
    ..
    dataset9

and I am affraid there is more. Some are confusing and now I want to know more :)

lichtkind commented 1 month ago

yes Documentation always needs improvement and i'm open to suggestions. (I think i last time met you in kiev.) It would be helpful if you tell me what you actually wanted to achieve. Sorry for delay.

Tux commented 1 month ago

Too long ago to remember what I wanted to achieve then. I /think/ the example shows what I ended up with.

It just took me a long time to find the right combination of attributes, as there is no list of supprted attributes in the docs