string diagram2(string Type, array Data, [array Options])
With the function diagram2()
data can be visualized which have been calculated before in the questionnaire – e.g. from the user's data via value()
or via statistic()
.
Currently this function can only display a polarity profile.
'polar
' – polarity profile'0000FF'
for blue)For example a multidimensional array could look like this:
array( array(1,2,3,4,5,6,7,8,10), // first data series array(1,4,2,3,5,7,2,1,2) // second data series )
An array with the options can look like this:
array( 'width' => 320, 'height' => 120, 'min' => 1, 'max' => 7, 'labels' => true, 'limit' => array(2,4) )
A diagram can be an output as follows:
$src = diagram2('polar', array( array('Alpha', 'Beta', 'Gamma', 'Delta', 'Epsilon', 'Zeta', 'Theta', 'Eta', 'Phi'), // Labels array(1,4,2,5,3,7,2,1,2) // Data ), array( 'width' => 320, 'height' => 120, 'labelwidth' => 100, 'min' => 1, 'max' => 7, 'labels' => true, 'limit' => array(2,5,7), 'limitcolor' => array('FFFF99', 'FFFFFF', 'FFFF99') ) ); html($src);