-
-
21 Jan 2020 03:51:59 UTC
- Distribution: Fl
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (86 / 0 / 0)
- Kwalitee
Bus factor: 1- License: artistic_2
- Perl: v5.8.1
- Activity
24 month- Tools
- Download (122.46KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- none
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Fl::Chart - Display Simple Chart Data
Synopsis
use Fl qw[:color]; my $win = Fl::Window->new(1000, 480); my $chart = Fl::Chart->new(20, 20, $win->w() - 40, $win->h() - 40, 'Chart'); $chart->bounds(-125, 125); for (my $t = 0; $t < 15; $t += 0.5) { my $val = sin($t) * 125.0; $chart->add($val, sprintf('%-.1f', $val), ($val < 0) ? FL_RED : FL_GREEN); } $win->resizable($win); $win->show(); exit Fl::run();
Description
Fl::Chart can display data in one of several formats. The following are imported from Fl with the
:chart
tag.Methods
Fl::Chart is a subclass of Fl::Widget but also supports these methods:
new(...)
The constructor creates a chart of a given size and position on screen or within the parent.
my $chart_a = Fl::Chart->new(100, 150, 300, 500);
...or...
my $chart_b = Fl::Chart->new(100, 150, 300, 500, 'Daily Volume');
In these examples, the new chart is placed 100 pixels from the left and 150 pixels down from the top of either the display area or parent widget.
The default boxtyle is
FL_NO_BOX
.The destructor also deletes all data.
add(...)
$chart->add(60, 'March 13, 2016', FL_RED); $chart->add(64.3);
Add the data value with optional label and color to the chart.
autosize(...)
$chart->autosize(1); my $resizing = $chart->autosize();
Get whether the chart will automatically adjust bounds of the chart. Returns non-zero if the chart will automatically resize.
Module Install Instructions
To install Fl, copy and paste the appropriate command in to your terminal.
cpanm Fl
perl -MCPAN -e shell install Fl
For more information on module installation, please visit the detailed CPAN module installation guide.