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
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
Post your debug (without the chart)
Need more details
What error, did you take out the chart widget like I said?
What error, did you take out the chart widget like I said?
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
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
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.
So how to filter if count in filter is higher then 3
having count(*)>3
does not work for me there
having count(*)>3
does not work for me there
Count(*)/>3:model.field
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
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
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
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
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
but i do not know how to make it work in chart widget
<?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
i put {var:custom_code12.$row['2']}
to data provider
x field: comuna
y field: count(*)
does not work
to data provider
x field: comuna
y field: count(*)
does not work
Should be {var:custom_code12.[n].comuna.field_name}
You haven't actually given Count(*) a name.
You haven't actually given Count(*) a name.
This topic is locked and no more replies can be posted.




