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