pablrod / p5-Chart-Plotly

Generate html/javascript charts with perl data using javascript library Plotly.js
MIT License
9 stars 4 forks source link

[Feature Request] Several plots in the same html #2

Closed weatherwax closed 7 years ago

weatherwax commented 7 years ago

It would be convenient to be able to draw several plots in the same html file. For example, with data => [\@data1, \@data2]

pablrod commented 7 years ago

Yes! But that syntax is already used for multiple traces in one plot.

What about something like this:

my $data1 = [1..5];
my $data2 = [map {rand 10} 1..20 ];
show_plot($data1, $data2);
weatherwax commented 7 years ago

You are right, I hadn't noticed.

pablrod commented 7 years ago

First try. Please see examples/multiple.pl (https://github.com/pablrod/p5-Chart-Plotly/commit/96340b5b40ba41b68392ed531f00aaf5af3a511c)

weatherwax commented 7 years ago

Great! Just what I was looking for.

pablrod commented 7 years ago

With the release of the version v0.009 we can draw multiple plots in the same html with show_plot and also get the html as a string with html_plot.