I’m trying to create a Chart with ListDataProvider (my Chart doesn’t get data from any entity). Therefore I created a Service Bean for the chart, in which I run a query to fetch data from MYSQL DB.
But when I try to insert the data fetched from the query to a List , in order to pass it to the Chart Controller, I get this error of Cannot access DataItem, as you can see in the screenshots below.
Option 1: Using ResultSetHandler
Option 2: Let the query return a List of normal map objects and then map it to MapDataItem…
I’m thinking that DataItem objects cannot be accessed from Service Layer. That is somehow understandable. If it’s the case, then is there suitable class to use with the Chart’s ListDataProvider ?
Thank you in advance and kind regards,