Skip to content

Generate html/javascript charts with perl data using javascript library Dygraphs

License

Notifications You must be signed in to change notification settings

pablrod/p5-Chart-Dygraphs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAME

Chart::Dygraphs - Generate html/javascript charts from perl data using javascript library Dygraphs

VERSION

version 0.007

SYNOPSIS

use Chart::Dygraphs qw(show_plot);

my $data = [map {[$_, rand($_)]} 1..10 ];
show_plot($data);

use Chart::Dygraphs qw(show_plot);
use DateTime;

my $start_date = DateTime->now(time_zone => 'UTC')->truncate(to => 'hour');
my $time_series_data = [map {[$start_date->add(hours => 1)->clone(), rand($_)]} 1..1000];

show_plot($time_series_data);

DESCRIPTION

Generate html/javascript charts from perl data using javascript library Dygraphs. The result is html that you could see in your favourite browser.

Example screenshot of plot generated with examples/time_series.pl:

Random time series plotted with Dygraphs

The API is subject to changes.

FUNCTIONS

render_full_html

Parameters

  • data:

    Data to be represented. The format is the perl version of the data expected by Dygraphs: http://dygraphs.com/data.html

  • options:

    Hashref with options for graph. The format is the perl version of the options expected by Dygraphs: http://dygraphs.com/options.html Optional

  • render_html_options

    Hashref with options controlling html output. With this you can inject html, javascript or styles.

    Supported options:

    • pre_graph_html
    • post_graph_html
    • dygraphs_div_id
    • dygraphs_javascript_object_name
    • dygraphs_div_inline_style

show_plot

Opens the plot in a browser locally

Parameters

Data to be represented. The format is the same as the parameter data in render_full_html

BUGS

Please report any bugs or feature requests via github: https://github.com/pablrod/p5-Chart-Dygraphs/issues

AUTHOR

Pablo Rodríguez González pablo.rodriguez.gonzalez@gmail.com

COPYRIGHT AND LICENSE

This software is copyright (c) 2016 by Pablo Rodríguez González.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

About

Generate html/javascript charts with perl data using javascript library Dygraphs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages