ChronoEngine.com homepage

Forums

Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.

Thank you for your support!

how it works chart widget?

samir1903 16 Nov, 2018
hi everyone?
it is in chronoforms 6

I couldnot make work chart element

i put data provider

curso is checked boxes element
inside there is contabilidad and mercadeo
i want to show in a graph of how many contabilidad and how many mercadeo in table
i could not
data reader is read_data15
module is Data15
Data provider: {var:read_data15.[n].Data15}
X Field name: curso
Y Field name: result.curso
healyhatman 17 Nov, 2018
Post your debug (without the chart)
samir1903 26 Nov, 2018
this is not working error
healyhatman 26 Nov, 2018
Need more details

What error, did you take out the chart widget like I said?
samir1903 27 Nov, 2018
I have found the answer for those who is saffuring the same issue

X field name returns values
Y field names return numbers therefore
X field names will be curso
Y field names will be Count(*) so it can count the records

i gues there is really lack of information in terms of chronoforms components and features published, i am looking basic things but i cannot finds some times in any where
thsnks
samir1903 27 Nov, 2018
also do not forget to put
fields to retriew in DB read
curso
Count(*)
healyhatman 27 Nov, 2018
Well yes if you want to display the count you need to retrieve the count, that's not really chronoforms fault. Glad you figured it out.
samir1903 03 Dec, 2018
So how to filter if count in filter is higher then 3

having count(*)>3

does not work for me there
samir1903 03 Dec, 2018
Thanks for quick answer but it didint work for me

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''comuna' GROUP BY `Data36.comuna`' at line 1
healyhatman 03 Dec, 2018
OK so apparently you need to use the HAVING clause and I don't think CF can handle that. I could be wrong, but in the meantime you have two options.

1) use a PHP block to take your array from $this->get("read_data#") and return an array of entries with count > 3

2) Make the database query yourself in PHP. https://docs.joomla.org/Special:MyLanguage/Selecting_data_using_JDatabase
samir1903 04 Dec, 2018
with custom_code12

<?php$app =& JFactory::getApplication();
$db =& JFactory::getDBO();
$query = " SELECT `comuna`,count(*) FROM `os5pk_chronoforms_xxx` WHERE `cumplen` = 'SI' GROUP BY `comuna` HAVING COUNT(*)> 3;";
$db->setQuery($query);
$row = $db->loadAssocList();
print_r($row);
return $row?>

i can see the results that i want with second method
Array ( [0] => Array ( [comuna] => [count(*)] => 37 ) [1] => Array ( [comuna] => 1 [count(*)] => 7 ) [2] => Array ( [comuna] => 11 [count(*)] => 6 ) [3] => Array ( [comuna] => 12 [count(*)] => 6 ) [4] => Array ( [comuna] => 13 [count(*)] => 8 ) [5] => Array ( [comuna] => 14 [count(*)] => 4 ) [6] => Array ( [comuna] => 15 [count(*)] => 23 ) [7] => Array ( [comuna] => 16 [count(*)] => 6 ) [8] => Array ( [comuna] => 18 [count(*)] => 8 ) [9] => Array ( [comuna] => 20 [count(*)] => 4 ) [10] => Array ( [comuna] => 21 [count(*)] => 15 ) [11] => Array ( [comuna] => 4 [count(*)] => 4 ) [12] => Array ( [comuna] => 6 [count(*)] => 6 ) [13] => Array ( [comuna] => 7 [count(*)] => 5 ) )

but i do not know how to make it work in chart widget
samir1903 04 Dec, 2018
i put {var:custom_code12.$row['2']}

to data provider

x field: comuna
y field: count(*)

does not work
samir1903 04 Dec, 2018
easier way is order comuna/desc
and disabled 3 records
healyhatman 04 Dec, 2018
Should be {var:custom_code12.[n].comuna.field_name}

You haven't actually given Count(*) a name.
This topic is locked and no more replies can be posted.

2Checkout.com

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com