How to get a piechart to display data from a ValueCollectionDatasource

I am trying to get my first chart (a piechart) to work. I have the following XML defined (with the sidemenu/table omitted). There is obviously data because it is displayed in the table, but there is no pie chart and the legend is all “NaN” and no description. I have tried expanding the size on the piechart but it is still empty. What am I doing wrong?



<dsContext>
        <valueCollectionDatasource id="customersRtypeDs">
            <query>
                <!&#91;CDATA&#91;select coalesce(c.descr,'Unknown') as descr, count(e) as reccount
                                 from rade$Customer e left join rade$CodeControl c
                                 where e.rtype = c.id.code
                                 and c.id.recType = 'T'
                                 and c.status = 'A'
                                 group by c.descr&#93;&#93;>
            </query>
            <properties>
                <property datatype="string"
                          name="descr"/>
                <property datatype="int"
                          name="reccount"/>
            </properties>
        </valueCollectionDatasource>
</dsContext>
   .
   .
   .

<chart:pieChart id="pieRecTypes"
                                    caption="Record Types Chart"
                                    datasource="customersRtypeDs"
                                    height="200px"
                                    titlefield="descr"
                                    valuefield="reccount"
                                    width="200px">
                        <chart:legend autoMargins="false"
                                      marginRight="80"
                                      markerType="CIRCLE"
                                      position="BOTTOM"/>
</chart:pieChart>

30cfb0f1c1b73bfdc78a6f654eae96d4

FOUND THE MISTAKE! “valuefield” must be “valueField” and “titlefield” must be “titleField”.

How hard would it be to get the XML editor in the Studio to validate against the XML schema and flag errors like this? Is that possible?

Hi Eric,

I recommend that you use IDE to edit XML of screens, since there are useful automatic completion and on-the-fly validation. Also for Intellij Idea there is really powerful CUBA Plugin that gives you additional hints, quick fixes and navigation.