Added percentages to labels
This commit is contained in:
parent
72038b34b4
commit
b75d7f8839
|
@ -103,7 +103,7 @@
|
|||
:colour "silver"
|
||||
:quantity 564243}
|
||||
{:id "reform"
|
||||
:label "Reform UK Ltd."
|
||||
:label "Reform UK"
|
||||
:colour "cyan"
|
||||
:quantity 4091549}
|
||||
{:id "greenew"
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
["M" (:x start) (:y start) "A" radius radius 0 large-arc? sweep
|
||||
(:x end) (:y end)])))
|
||||
|
||||
(def ^:dynamic *minor-segment-threshold* 0.07)
|
||||
(def ^:dynamic *minor-segment-threshold* 0.08)
|
||||
|
||||
(defn- minor-segment? [datum]
|
||||
(< (- (:right datum) (:left datum)) *minor-segment-threshold*))
|
||||
|
@ -97,7 +97,7 @@
|
|||
:font-weight "bold"
|
||||
:font-size (str (font-size thickness))}}
|
||||
[:textPath {:xlink:href (str "#" tp-id)
|
||||
:startOffset "2%"} [:tspan (:label datum)]]]]))
|
||||
:startOffset "2%"} [:tspan (format "%s: %.2f%%" (:label datum) (* 100 (:proportion datum)))]]]]))
|
||||
|
||||
;; <text
|
||||
;; xml:space="preserve"
|
||||
|
|
Loading…
Reference in a new issue