Permalink
Browse files

nicer ws layout

  • Loading branch information...
moritz committed Aug 16, 2009
1 parent 576a99c commit c10b8a3f1f803845e553d276046953dfbe11ca25
Showing with 10 additions and 10 deletions.
  1. +10 −10 lib/SVG/Plot.pm
View
@@ -1,19 +1,19 @@
class SVG::Plot {
- has $.height = 200;
- has $.width = 300;
- has $.fill-width = 0.80;
- has $.label-font-size = 14;
- has $.plot-width = $.width * 0.80;
- has $.plot-height = $.height * 0.65;
-
- has &.y-tick-step = -> $max_y {
+ has $.height = 200;
+ has $.width = 300;
+ has $.fill-width = 0.80;
+ has $.label-font-size = 14;
+ has $.plot-width = $.width * 0.80;
+ has $.plot-height = $.height * 0.65;
+
+ has &.y-tick-step = -> $max_y {
10 ** floor(log10($max_y)) / 5
}
- has $.max-x-labels = $.plot-width / (1.5 * $.label-font-size);
+ has $.max-x-labels = $.plot-width / (1.5 * $.label-font-size);
- has $.label-spacing = ($.height - $.plot-height) / 20;
+ has $.label-spacing = ($.height - $.plot-height) / 20;
method plot(@data, @labels = @data.keys, :$full = True) {
my $label-skip = ceiling(@data / $.max-x-labels);

0 comments on commit c10b8a3

Please sign in to comment.