View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0025523 | mantisbt | plug-ins | public | 2019-02-26 11:57 | 2019-08-02 13:46 |
Reporter | dregad | Assigned To | dregad | ||
Priority | normal | Severity | minor | Reproducibility | N/A |
Status | closed | Resolution | fixed | ||
Target Version | 2.20.0 | Fixed in Version | 2.20.0 | ||
Summary | 0025523: MantisGraph: improve handling of colors in Pie charts | ||||
Description | Currently, the color for Pie Chart slices are defined based on $g_status_colors config. This potentially has fewer colors defined than the number of slices on the chart, resulting in a pie where only the first few slices are colored, and the remaining ones are shown in a default gray, as shown in attached screenshot by_category_pie_chart.png. Using $g_status_colors only makes sense for By Status charts, we should use a wider color palette for other pie charts. | ||||
Additional Information | Follows discussion in https://github.com/mantisbt/mantisbt/pull/1467#issuecomment-467175008 | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Note that even in Status chart, the colors applied don't match the status colors. This happens when not all status are represented in the graph. Easily reproducible with a filtered summary. |
|
Very good point, I never realized that as in my tests I always had a data set covering all statuses. Shouldn't be too difficult to adjust the color list to match the dataset though. |
|
@cproensa This should be fixed in above-mentioned PR. |
|
MantisBT: master 4e3aca87 2019-02-26 05:50 Details Diff |
Add chartjs-plugin-colorschemes This Chart.js plugins defines a number of preset color schemes https://github.com/nagix/chartjs-plugin-colorschemes Requires Chart.js 2.5.0 or later. Issue 0025523 |
Affected Issues 0025523 |
|
mod - library/README.md | Diff File | ||
mod - plugins/MantisGraph/MantisGraph.php | Diff File | ||
add - plugins/MantisGraph/files/chartjs-plugin-colorschemes.min.js | Diff File | ||
MantisBT: master 29fe7122 2019-02-26 06:43 Details Diff |
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 |
Affected Issues 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 | ||
MantisBT: master a10cb8e6 2019-02-27 00:35 Details Diff |
New helper function to get status color by label Issue 0025523 |
Affected Issues 0025523 |
|
mod - core/helper_api.php | Diff File | ||
MantisBT: master 0012edaf 2019-02-27 00:52 Details Diff |
Only get status colors matching the graph's data Prior to this, the whole set of status colors was returned, resulting in colors sometimes not matching the actual status when some of them are not present in the chart's dataset (as mentioned in 0025523:0061577). Fixes 0025523 |
Affected Issues 0025523 |
|
mod - plugins/MantisGraph/core/graph_api.php | Diff File | ||
MantisBT: master 45dca872 2019-02-27 00:59 Details Diff |
Allow custom fallback status color When no color is defined in $g_status_color for a given status, get_status_color() falls back to a hardcoded pure white (#ffffff). This lets the caller specify which color to use in this case. Issue 0025523 |
Affected Issues 0025523 |
|
mod - core/helper_api.php | Diff File | ||
MantisBT: master 00d3f831 2019-02-27 01:01 Details Diff |
Use light gray as fallback for graph status color The MantisBT default (white) causes the pie chart (or a part of it) to become invisible unless the user hovers their mouse on top of them, since the slices are displayed without border. Issue 0025523 |
Affected Issues 0025523 |
|
mod - plugins/MantisGraph/core/graph_api.php | Diff File |