indexing description: "[ A slice of a pie (-chart) Values should not be negative. Can have explicit color or none at all (color = Void) If no explicit color is given, the pie-chart will color the slice automatically. Slices can easily be created by conversion from tuples. ]" author: "" date: "$Date$" revision: "$Revision$" class EM_VIZ_PIE_SLICE create make, make_from_tuple, make_from_triple convert make_from_tuple ({TUPLE [DOUBLE, STRING]}), make_from_triple ({TUPLE [DOUBLE, STRING, EM_COLOR]}) feature -- Initialization make_from_tuple (t: TUPLE [v: DOUBLE; t: STRING]) is -- Make new slice from tuple do make (t.v, t.t, Void) end make_from_triple (t: TUPLE [v: DOUBLE; t: STRING; c: EM_COLOR]) is -- Make new slice from triple do make (t.v, t.t, t.c) end make (a_value: like value; a_text: like label_text; a_color: like color) is -- Make new slice require not_negative: 0.0 <= a_value text_exists: a_text /= Void do set_value (a_value) set_label_text (a_text) set_color (a_color) end feature -- Access value: DOUBLE -- Value of slice label_text: STRING -- Text for label color: EM_COLOR -- Color of slice (may be Void) feature -- Element change set_value (a_value: like value) is -- require not_negative: 0.0 <= a_value do value := a_value ensure set: value = a_value end set_label_text (a_text: like label_text) is -- Set label text require text_exists: a_text /= Void do label_text := a_text ensure set: label_text = a_text end set_color (a_color: like color) is -- Set color (can be Void) do color := a_color ensure set: color = a_color end end