Specify mappings from levels in the data to displayed fill colours.
Arguments
- x
an
ms_chartobject.- values
character(num of series|1): a set of colour values to map data values to. It is a named vector, the values will be matched based on the names. If it contains only one colour, this colour will be associated to all existing series.- update_stroke
if
TRUE(the default), the series stroke colour is also updated tovalues, so that the filled shape and its border match. Series whose stroke was set to"transparent"(for example by thems_areachart()andms_piechart()constructors) are left untouched to preserve that deliberate "no border" default. Set toFALSEto keep the current stroke colours untouched and manage them independently viachart_data_stroke().
See also
Other Series customization functions:
chart_data_line_style(),
chart_data_line_width(),
chart_data_size(),
chart_data_smooth(),
chart_data_stroke(),
chart_data_symbol(),
chart_labels_text()
Examples
my_scatter <- ms_scatterchart(data = iris, x = "Sepal.Length",
y = "Sepal.Width", group = "Species")
my_scatter <- chart_data_fill(my_scatter,
values = c(virginica = "#6FA2FF", versicolor = "#FF6161", setosa = "#81FF5B") )
