Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

SVG::TT::graph::Line X label step size

by user2829 (Acolyte)
on Jan 27, 2012 at 00:35 UTC ( #950241=perlquestion: print w/ replies, xml ) Need Help??
user2829 has asked for the wisdom of the Perl Monks concerning the following question:

Hi All, I am trying to scale the number of points printed on X label. I am trying to use step_x_labels feature by setting it to 2 or 3 but doesn't seem to be working. I am also trying to print a limit line in the final printed graph. I have 400 data points ( Amplitude vs Frequencies ) and printing all the labels gives it a very ugly look :(.. I am also trying to point the maximum Amplitude and Frequency Data Point. I would appreciate for a reply/guidance. User2829

Comment on SVG::TT::graph::Line X label step size
Re: SVG::TT::graph::Line X label step size
by GrandFather (Cardinal) on Jan 27, 2012 at 00:42 UTC

    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
      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
Re: SVG::TT::graph::Line X label step size
by choroba (Abbot) on Jan 27, 2012 at 09:47 UTC
    Crossposted at StackOverflow. It is better to inform about the fact so people willing to help can profit from the help already given in the other site.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://950241]
Approved by GrandFather
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2014-08-01 01:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (256 votes), past polls