in reply to Plotting the data using different axes

Hi Sarat1729! Could you include (samples of) the datasets in the post? Also, I don't see any GD::Graph::Mixed in CPAN. Are you sure you got the name right?

This isn't a code writing service. What have you tried? How did it fail?

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: Plotting the data using different axes
by LanX (Saint) on Jun 05, 2018 at 10:26 UTC
Re^2: Plotting the data using different axes
by Sarat1729 (Sexton) on Jun 05, 2018 at 09:50 UTC
    I tried the below code.
    my $graph = new GD::Graph::mixed( 900, 600 ); my @data = ( [ '1st', '2nd', '3rd', '4th', '5th' ], [ 3300, 2400, 2300, 1900, 2100 ], [ 500, 550, 900, 510, 400 ], [ 250, 350, 400, 710, 200 ] ); $graph->set( title => TITLE, two_axes => 1, use_axis => [1,2,2], x_label => "Day", y1_label => "Minutes", y2_label => "Hours", long_ticks => 1, y_tick_number => 8, y1_label_skip => 2, y2_label_skip => 2, bar_spacing => 40, types => [ qw(bars linespoints linespoints) ], );

    In the dataset 3300 ... 2100, should be plotted in bars using left y axis, which is working. 500 ... 400 and 250 ... 200 should be plotted in linespoints which is also working but referring to left y axis. However, my intent is, it should be plotted according to right y axis. Also, right y axis is getting plotted.

    2018-06-08 Athanasius added code tags