#3956 closed Bug (fixed)

API (3D) pie charts with wrong legend / label.

Reported by: hornbeam Owned by: Benaka Moorthi
Priority: low Milestone: 1.12 - The Great 1.x Backlog
Component: Core Keywords:
Cc: Sensitive: no


I noticed that (3D) pie charts which have discrete number of elements have wrong last item label in some cases. This bug is at least from 1.11 to now (1.12-b20). Example :

1.) I use following code to generate pie chart of Visits by day of week (in my case there is afterwards some additional image post processing):

wget "http://piwik.###############/index.php?module=API&method=ImageGraph.get&idSite=##&apiModule=VisitTime&apiAction=getByDayOfWeek&token_auth=#########&graphType=3dPie&period=month&date=today&width=500&height=250&column=nb_visits&aliasedGraph=1&showLegend=1&filter_truncate=7" > weekdays.png

2.) If value of "filter_truncate" is 5 (default value) API gives correct result, because pie chart merges less visited 2 days under "Others" label. This behavior is expected and correct.
3.) If you change "filter_truncate" to 6 then you have 6 most visited days of week last is under "Others" label what is also correct.
4.) If you change "filter_truncate" to to 7 or more all item labels should have correct value and no "Others" should be displayed, because there is no other items.

In general when drawing (3D) pie charts with API in cases where we have discrete number of items known in advance, if "filter_truncate" is equal or more to number of discrete number of items last item should have correct label instead of "Others".

You can observe http://www.si-vreme.com/o-portalu/statistika with filter_truncate=7 last pie chart.

Change History (1)

comment:1 Changed 11 months ago by capedfuzz (diosmosis)

  • Owner set to Benaka Moorthi
  • Resolution set to fixed
  • Status changed from new to closed

In 047586ce989d5a5a5b451612963fa1324538c568:

Fixes #3956, don't rename last piece of data to Others in Pie static graph (in ImageGraph) since logic is handled by truncate filter.

Note: See TracTickets for help on using tickets.