Commit fb2912b6 authored by Frank Bergmann's avatar Frank Bergmann

-- fixed query and legend (pie chart)

parent 53ce2cf4
...@@ -36,7 +36,7 @@ Ext.onReady(function () { ...@@ -36,7 +36,7 @@ Ext.onReady(function () {
var translationProjectFeedbackNonConformityProportionStore = Ext.create('Ext.data.Store', { var translationProjectFeedbackNonConformityProportionStore = Ext.create('Ext.data.Store', {
fields: [ fields: [
{ name: 'choice', type: 'string' }, { name: 'category', type: 'string' },
{ name: 'count', type: 'int'} { name: 'count', type: 'int'}
], ],
autoLoad: true, autoLoad: true,
...@@ -134,7 +134,7 @@ Ext.onReady(function () { ...@@ -134,7 +134,7 @@ Ext.onReady(function () {
} }
}, },
label: { label: {
field: 'choice', field: 'category',
display: 'rotate', display: 'rotate',
contrast: true, contrast: true,
font: '11px "Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif', font: '11px "Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif',
......
...@@ -525,7 +525,7 @@ BEGIN ...@@ -525,7 +525,7 @@ BEGIN
r.related_object_id r.related_object_id
from from
im_projects p, im_projects p,
survsimp_responses r, (select distinct on (related_object_id) * from survsimp_responses order by related_object_id, response_id DESC) r,
survsimp_question_responses qr, survsimp_question_responses qr,
survsimp_surveys s, survsimp_surveys s,
survsimp_questions q survsimp_questions q
...@@ -599,7 +599,12 @@ BEGIN ...@@ -599,7 +599,12 @@ BEGIN
set set
report_sql = ' report_sql = '
select select
im_category_from_id(choice_id) as category, CASE qr.choice_id is null
WHEN true THEN
''None''
ELSE
(select label from survsimp_question_choices where choice_id = qr.choice_id)
END as category,
count(*) count(*)
from from
( (
...@@ -618,9 +623,8 @@ BEGIN ...@@ -618,9 +623,8 @@ BEGIN
and r.related_object_id = p.project_id and r.related_object_id = p.project_id
and r.response_id = qr.response_id and r.response_id = qr.response_id
and q.survey_id = s.survey_id and q.survey_id = s.survey_id
and (q.question_text = ''Sub Type'') and q.question_text = ''Sub Type''
and q.question_id = qr.question_id and q.question_id = qr.question_id
and qr.choice_id is not null
and p.start_date::date between ''%start_date%''::date and ''%end_date%''::date and p.start_date::date between ''%start_date%''::date and ''%end_date%''::date
and p.parent_id is null and p.parent_id is null
and project_id in ( and project_id in (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment