# --------------------------------------------------- # create the survey 1 mean chart using Chart::Clicker # --------------------------------------------------- # instantiate new Chart::Clicker object my $cc = Chart::Clicker -> new(width => 800, height => 400); # define ticks, series and dataset for chart my $ticks = {labels => ['Q 1A', 'Q 2', 'Q 3', 'Q 4', 'Q 5', 'Q 6A'], "values" => [1, 2, 3, 4, 5, 6],}; my $series = Chart::Clicker::Data::Series -> new(keys => $ticks -> {values}, values => \@qavg); my $ds = Chart::Clicker::Data::DataSet -> new(series => [$series],); # define Chart::Clicker context my $context = $cc -> get_context('default'); $context -> range_axis -> hidden(1); $context -> range_axis -> fudge_amount(.01); $context -> range_axis -> ticks(5); $context -> range_axis -> range -> min(0); $context -> range_axis -> range -> max(5); $context -> range_axis -> label('Survey Scores'); $context -> range_axis -> brush -> width(1); $context -> domain_axis -> hidden(0); $context -> domain_axis -> fudge_amount(.1); $context -> domain_axis -> baseline(1); $context -> domain_axis -> tick_values($ticks -> {values}); $context -> domain_axis -> tick_labels($ticks -> {labels}); $context -> domain_axis -> tick_label_angle(); $context -> domain_axis -> label("Survey Questions"); $context -> domain_axis -> brush -> width(1); # define data allocator for the chart's bar color my $ca = Chart::Clicker::Drawing::ColorAllocator -> new(); my $blue = Graphics::Color::RGB -> new({red => .15, green => .3, blue => .5, alpha => .75}); $ca -> add_to_colors($blue); # instantiate a new renderer (bar chart) my $renderer = Chart::Clicker::Renderer::Bar -> new(); # finish setting the chart parameters $cc -> add_to_datasets($ds); $cc -> set_renderer($renderer); $cc -> color_allocator($ca); $cc -> border -> width(1); $cc -> legend -> visible(0); # define chart title $cc -> title -> text('Dynamic Charting: Survey 1 - Front End of Business (Mean Analysis)'); $cc -> title -> font -> size(20); $cc -> title -> padding -> bottom(10); # render the chart $cc -> draw; $cc -> write('/home/wiw/public_html/tmp/s1avg.png');