Buy Now
Sign in

create statistics using the chart widget

Fredolino , January 27 2020, 13:13
Fredolino 630
January 27 2020, 13:13 #390933
Hi,

I would like to create statistics using the chart widget.
However, I have too little information on how this widget works.
There are few posts about it but I can't get any further.
I also can't see a debugger because the widget only shows me a blank white page.
It should look like on the screen later.

Here is my current status in the form:

FUNCTIONS:
Name: read_rl_bbg
Model:BBG
All matching records
Fields to retrieve: rl_bbg
Group fields: BBG.rl_bbg

VIEW:
Chart-Name: rote_liste
Data provider: {var:read_rl_bbg}.[n].BBG}
X Field name: rl
Y Field name: rl_result
x axis label: x-label
x axis label: y-label

EVENTS:
Name: index
{fn:read_rl_bbg}
{view:rote_liste}
{debug:read_rl_bbg}table_screen.jpg
Fredolino 630
January 27 2020, 16:28 #390936
ok, new:
I have this just in read_data/Fields to retrieve:
art_id
COUNT(*):BBG.count_species
rl_bbg

Group fields: rl_bbg
Debug:
Array
(
[log] => Array
(
[0] => SELECT `BBG`.`art_id` AS `BBG.art_id`, COUNT(*) AS `BBG.count_species`, `BBG`.`rl_bbg` AS `BBG.rl_bbg` FROM `mtb_haupt_brandenburg` AS `BBG` GROUP BY `BBG.rl_bbg` LIMIT 100;
)
.....
In my Table under VIEW display result correct.
But the chart page is white and blank. Why is that?
healyhatman 9
January 27 2020, 23:13 #390944
You need to add results to it in the same way you add them to CSV. So something like {var:read_data.model.[n].field} or model.[n].field or whatever. Needs to be a 1D array not associative.
Also, it's not that much harder and a LOT nicer to just use Google Charts.
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
Fredolino 630
January 28 2020, 16:06 #390951
When I use that:
X Fieldname: BBG.[n].art_id
{var:BBG.[n].count_species}
Then comes the error message:
"Unsupported operand types"

And when I create a "Custom code" function under "Function", it doesn't show me a Google Chart, only the arrays.
Screenshot_2020-01-28.png
Attachments
Screenshot_2020-01-28.png
Screenshot_2020-01-28.png
(43.23 KiB)
155 Downloads/Views
Screenshot_2020-01-28.png
Screenshot_2020-01-28.png
(43.23 KiB)
169 Downloads/Views
Fredolino 630
January 28 2020, 17:22 #390952
 1
 Answer
:-) solved with in CC6-Chart:
X Field: art_id
Y Field: count_species