aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès2009-05-27 21:27:54 +0200
committerLudovic Courtès2009-05-27 21:27:54 +0200
commitc9157a3905fc17a70d36ec46db809efb91c14887 (patch)
tree14248ff51b0af5ffa95a16a2b3fed13b931f53e1
parent6532b3df7bbe88613da0ba9dd3a9d429084ec896 (diff)
downloadskribilo-c9157a3905fc17a70d36ec46db809efb91c14887.tar.gz
skribilo-c9157a3905fc17a70d36ec46db809efb91c14887.tar.lz
skribilo-c9157a3905fc17a70d36ec46db809efb91c14887.zip
pie: Choose saner defaults for Ploticus.
* src/guile/skribilo/package/pie.scm (ploticus-script)[radius]: Default to 2.5. [center]: Default to (6.25, 6.25). The latter allows pie charts to not be truncated, even in `line+label', provided RADIUS remains in the [0..4cm] range.
-rw-r--r--NEWS1
-rw-r--r--src/guile/skribilo/package/pie.scm27
2 files changed, 12 insertions, 16 deletions
diff --git a/NEWS b/NEWS
index 96fcdb0..ca23411 100644
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,7 @@ Previously, footnotes would not get printed in the case of chapters that
are not output in a separate file.
** HTML engine: use ". " as the default chapter number-title separator
+** Improved rendering of pie charts with Ploticus
** New experimental `--enable-guile-vm' configure switch
This allows compilation with the compiler of "Guile-VM", i.e., the
diff --git a/src/guile/skribilo/package/pie.scm b/src/guile/skribilo/package/pie.scm
index 0b0d622..f99c725 100644
--- a/src/guile/skribilo/package/pie.scm
+++ b/src/guile/skribilo/package/pie.scm
@@ -1,6 +1,6 @@
;;; pie.scm -- An pie-chart formatting package.
;;;
-;;; Copyright 2005, 2006, 2007 Ludovic Courtès <ludovic.courtes@laas.fr>
+;;; Copyright 2005, 2006, 2007, 2009 Ludovic Courtès <ludo@gnu.org>
;;;
;;;
;;; This program is free software; you can redistribute it and/or modify
@@ -202,19 +202,9 @@ the string \"hello\". Implement `sliceweight' markups too."
(initial-angle (or (markup-option pie :initial-angle)
0))
- (radius (or ;;FIXME
- (markup-option pie :radius) 3))
- (max-radius (+ radius (apply max detached)))
-
- ;; center coordinates must take into account (i) the
- ;; maxium radius when detached slices are considered and
- ;; (ii) the fact that labels may get displayed to the
- ;; left of the pie.
- ;; FIXME: labels to the left (ii) end up being truncated
- ;; when the radius is e.g. < 2.
- (center `(,(+ max-radius
- (* max-radius max-radius)) .
- ,(* max-radius max-radius))))
+ (radius (or (markup-option pie :radius)
+ ;; 2.5cm is the default used in `pie.pl'.
+ 2.5)))
(string-concatenate
(append (list "#proc getdata\n" "data: ")
@@ -233,8 +223,13 @@ the string \"hello\". Implement `sliceweight' markups too."
"datafield: " "1" "\n")
`("firstslice: " ,(number->string initial-angle) "\n")
`("radius: " ,(number->string radius) "\n")
- `("center: " ,(number->string (car center))
- " " ,(number->string (cdr center)) "\n")
+
+ ;; This value is the default used in `pie.pl'. It happens
+ ;; to work well (at least in PNG output) for 1 < RADIUS < 4.
+ ;; XXX: For RADIUS beyond that, the pie or labels are
+ ;; often truncated.
+ `("center: 6.25 6.25\n")
+
`("labelmode: "
,(case (markup-option
pie :labels)