Buy Now
Sign in

how it works chart widget?

samir1903 , November 16 2018
S
samir1903
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
Post your debug (without the chart)
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

DON'T COPY+PASTE FROM THE FORUMS! It adds hidden code-breaking format characters!
S
samir1903
this is not working error
healyhatman
Need more details
What error, did you take out the chart widget like I said?
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

DON'T COPY+PASTE FROM THE FORUMS! It adds hidden code-breaking format characters!
S
samir1903
1.png
4.png
2.png
3.png

​​
5.png
Attachments
1.png
1.png
(12.65 KiB)
79 Downloads/Views
2.png
2.png
(8.63 KiB)
78 Downloads/Views
1.png
1.png
(12.65 KiB)
108 Downloads/Views
2.png
2.png
(8.63 KiB)
105 Downloads/Views
3.png
3.png
(17.77 KiB)
108 Downloads/Views
4.png
4.png
(11.78 KiB)
79 Downloads/Views
5.png
5.png
(5.91 KiB)
109 Downloads/Views
4.png
4.png
(11.78 KiB)
110 Downloads/Views
S
samir1903
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
S
samir1903
also do not forget to put ​
​fields to retriew in DB read
curso
Count(*)
healyhatman
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.
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

DON'T COPY+PASTE FROM THE FORUMS! It adds hidden code-breaking format characters!
S
samir1903
So how to filter if count in filter is higher then 3
having count(*)>3
does not work for me there
healyhatman
Count(*)/>3:model.field
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

DON'T COPY+PASTE FROM THE FORUMS! It adds hidden code-breaking format characters!
S
samir1903
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
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
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

DON'T COPY+PASTE FROM THE FORUMS! It adds hidden code-breaking format characters!
S
samir1903
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
S
samir1903
i put {var:custom_code12.$row['2']}
to data provider
x field: comuna
y field: count(*)
does not work
S
samir1903
easier way is order comuna/desc
and disabled 3 records
healyhatman
Should be {var:custom_code12.[n].comuna.field_name}
You haven't actually given Count(*) a name.
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman

DON'T COPY+PASTE FROM THE FORUMS! It adds hidden code-breaking format characters!