http://www.perlmonks.org?node_id=950242


in reply to SVG::TT::graph::Line X label step size

I'm almost sure it is a copy and paste error in line 42, but without any sample code that I can run to reproduce the error it's a little hard to be sure.

You will get better answers if you include a little (5 - 30 lines) code that demonstrates the problem you are having.

True laziness is hard work
  • Comment on Re: SVG::TT::graph::Line X label step size

Replies are listed 'Best First'.
Re^2: SVG::TT::graph::Line X label step size
by user2829 (Acolyte) on Jan 27, 2012 at 07:51 UTC
    here is the code... Thank you for the reply
    use SVG::TT::Graph::Line; my @fields = qw(Jan Feb Mar Jan Feb Mar Jan Feb Mar Jan Feb Mar Jan F +eb Mar Jan Feb Mar ); my @data_sales_02 = qw(12 45 21 12 45 21 12 45 21 12 45 21 12 45 21 12 + 45 21); my @data_sales_03 = qw(-15 -30 -40); open(IMG, ">>Wf.html") or print "Error:- $!"; my $graph = SVG::TT::Graph::Line->new({ 'height' => '500', 'width' => '300', 'fields' => \@fields, 'min_scale_value' => '0', 'max_scale_value' => '100', 'step_x_labels' => '2', }); $graph->add_data({ 'data' => \@data_sales_02, 'title' => 'Sales 2002', }); #print "Content-type: image/svg+xml\n\n"; print IMG $graph->burn();

      Adding stagger_x_labels => 1, to the new parameter list generates a graph with non-overlapping x labels for me. Another possibility is to use rotate_x_labels => 1,, although that rotates the labels the wrong way for my taste.

      True laziness is hard work