Buy Now
Sign in

Chart Widget, How to Calculate.

H
har7801
Hi,
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.
Thanks.
Capture.JPG
DB.JPG
GreyHead
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
SELECT COUNT(DISTINCT DEvent) FROM #_table_name
Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
healyhatman
Hey har7801 mind telling me how you got the chart to display?
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman
A
ataylor14
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: https://www.chronoengine.com/forums/posts/t105160/how-use-chart-widget
there is an answer from Admin.
Hope it helps. I spend quite some time trying to make it work myself.
Amelia
healyhatman
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 SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman