MantisBT: master 29fe7122

Author Committer Branch Timestamp Parent
dregad dregad master 2019-02-26 11:43:26 master caaa3fc4
Affected Issues  0025523: MantisGraph: improve handling of colors in Pie charts
Changeset

Set color scheme for Pie charts

Add a new optional boolean parameter to graph_pie() API, so that the
caller can decide whether they want to use the default color scheme, or
the configured MantisBT colors.

When the data attribute is undefined, Chart.js uses the colors from
chartjs-plugin-colorschemes, otherwise

This allows using a wider palette for Pie charts that potentially have
more values than defined by $g_status_colors such as By Category.

Additionally as a small optimization, there is no need to define two
sets of color data attributes (for border and background), since they
are identical

Fixes 0025523

mod - plugins/MantisGraph/core/graph_api.php Diff File
mod - plugins/MantisGraph/files/MantisGraph.js Diff File
mod - plugins/MantisGraph/pages/status_graph.php Diff File