Buy Now
Sign in

Chart Widget, How to Calculate.

har7801 160
May 22 2018, 03:38 #377867
I can get the chart function returning results and displaying, but it isn't what I though it was. Can the chart function add columns of the same name?
I have a DB with lists of peoples name, against an event type, and I put a '1' value in thee for good measure for a count in EXCEL if needed. Many of the names are entered into the DB dozens of times against the same type of event or different. Does the chart have the ability to add by same type. For instance if I was in the DB 15 time and attended 7 meeting, 5 training, 3 drive, could the chart show that. It would be in the DB as 15 separate lines.
If not is there a simple script that I can write that would output that kind of result?
Current Result output as attached, you can see what I mean by wanting to count the events of similar type. So I want it to return Monthly Meeting 2, Officer Meeting 2, The rest would be one. At the end of a calendar year this result would be huge otherwise. We only have 7 event types for reporting.
DB looks like, attached. Dont need it to sort by name as this is being called in the selection process through a table and article_id= in the web address.
GreyHead 64
May 22 2018, 09:17 #377882
Hi har7801,
I think that you need to write a MySQL query (or a set of queries) that gives you the data you need. You should be able to do this with a query like this
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
healyhatman 9
May 22 2018, 15:26 #377895
Hey har7801 mind telling me how you got the chart to display?
Web developer at - I DO NOT work for ChronoEngine!
Professional Work:
Custom CF / CC Plugins and Extensions:
ataylor14 156
May 27 2018, 16:50 #377967
Hello har7801
You need to group by DEvent in the Read function that pulls data from the table.
Hi healyhatman,
I managed to do it with the following settings in the Chart Widget view:
Data provider: {var:read_data_function.[n].modelname}
XField name: fieldnameforX    Field name: fieldnameforY
See this:
there is an answer from Admin.
Hope it helps. I spend quite some time trying to make it work myself.
healyhatman 9
May 27 2018, 22:07 #377969
Yep that did it. I've never seen [n] used in Chronoforms/CC so there's no way I would've ever guessed that.
Web developer at - I DO NOT work for ChronoEngine!
Professional Work:
Custom CF / CC Plugins and Extensions: