3 * FusionForge Survey HTML Facility
5 * Portions Copyright 1999-2001 (c) VA Linux Systems
6 * The rest Copyright 2002-2004 (c) GForge Team - Sung Kim
7 * Copyright 2008-2010 (c) FusionForge Team
8 * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
9 * Copyright 2013, Franck Villaume - TrivialDev
10 * http://fusionforge.org/
12 * This file is part of FusionForge. FusionForge is free software;
13 * you can redistribute it and/or modify it under the terms of the
14 * GNU General Public License as published by the Free Software
15 * Foundation; either version 2 of the Licence, or (at your option)
18 * FusionForge is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License along
24 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
25 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 require_once $gfcommon.'include/pre.php';
29 require_once $gfwww.'include/note.php';
32 * Survey HTML related functions
34 class SurveyHTML extends Error {
39 function SurveyHTML() {
46 function header($params) {
47 global $group_id,$is_admin_page,$HTML;
49 if (!forge_get_config('use_survey')) {
53 $params['toptab']='surveys';
54 $params['group']=$group_id;
56 if ($project = group_get_object($group_id)){
57 if (!$project->usesSurvey()) {
61 if ($is_admin_page && $group_id) {
62 $params['submenu'] = $HTML->subMenu(
70 '/survey/admin/survey.php?group_id='.$group_id,
71 '/survey/admin/question.php?group_id='.$group_id,
72 '/survey/admin/show_results.php?group_id='.$group_id,
73 '/survey/admin/?group_id='.$group_id
77 $labels[] = _('Views Surveys');
78 $links[] = '/survey/?group_id='.$group_id;
79 if (forge_check_perm ('project_admin', $group_id)) {
80 $labels[] = _('Administration');
81 $links[] = '/survey/admin/?group_id='.$group_id;
83 $params['submenu'] = $HTML->subMenu($labels,$links);
85 site_project_header($params);
86 }// end if (valid group id)
92 function footer($params) {
93 site_project_footer($params);
97 * Show Add/Modify Question Forums
98 * @param Survey Question Question Object
101 function showAddQuestionForm( &$q ) {
105 $question_button = _('Add this Question');
107 /* If we have a question object, it is a Modify */
108 if ($q && is_object($q) && !$q->isError() && $q->getID()) {
109 $warning_msg = '<p class="warning_msg">'.
110 _('WARNING! It is a bad idea to change a question after responses to it have been submitted').
112 $question_id = $q->getID();
113 $question = $q->getQuestion();
114 $question_type = $q->getQuestionType();
115 $question_button = _('Submit Changes');
124 $ret.='<form action="'.getStringFromServer('PHP_SELF').'" method="post">' . "\n";
125 $ret.='<p><input type="hidden" name="post" value="Y" />';
126 $ret.='<input type="hidden" name="group_id" value="'.$group_id.'" />';
127 $ret.='<input type="hidden" name="question_id" value="'.$question_id.'" />';
128 $ret.='<input type="hidden" name="form_key" value="' . form_generate_key() . '" />';
129 $ret.=_('Question').':<br />';
130 $ret.='<input type="text" name="question" value="'.$question.'" size="60" maxlength="150" /></p>';
131 $ret.='<p>'. _('Question Type').':<br />';
133 $result = db_query_params ('SELECT * FROM survey_question_types',
135 $ret.= html_build_select_box($result,'question_type',$question_type,false);
137 $ret.='</p><p><input type="submit" name="submit" value="'.$question_button.'" /></p>' . "\n";
138 $ret.='</form>' . "\n";
144 * Show Add/Modify Question Forums
145 * @param Survey Question Question Object
148 function showAddSurveyForm( &$s) {
152 /* If no question is available */
153 if (! $survey_id && ! count($s->getAddableQuestionInstances())) {
154 $ret = '<p>' . sprintf(_('Please %1$s create a question %2$s before creating a survey'),
155 '<a href="'.util_make_url('/survey/admin/question.php?group_id='.$group_id).'">',
162 $survey_button = _('Add this Survey');
163 $active = ' checked="checked" ';
166 /* If we have a survey object, it is a Modify */
167 if ($s && is_object($s) && !$s->isError() && $s->getID()) {
168 $warning_msg = '<p class="warning_msg">'.
169 _('WARNING! It is a bad idea to edit a survey after responses have been posted').'</p>';
170 $survey_id = $s->getID();
171 $survey_title = $s->getTitle();
172 $survey_questions = $s->getQuestionString();
173 $survey_button = _('Submit Changes');
174 if (!$s->isActive()) {
175 $inactive = 'checked ="checked" ';
180 $survey_questions = '';
185 $ret.='<form action="'.getStringFromServer('PHP_SELF').'" method="post">';
186 $ret.='<p><input type="hidden" name="post" value="Y" />';
187 $ret.='<input type="hidden" name="group_id" value="'.$group_id.'" />';
188 $ret.='<input type="hidden" name="survey_id" value="'.$survey_id.'" />';
189 $ret.='<input type="hidden" name="survey_questions" value="'.$survey_questions.'" />';
190 $ret.='<input type="hidden" name="form_key" value="' . form_generate_key() . '" />';
191 $ret.='<strong>'._('Survey Title')._(':').'</strong>'.utils_requiredField();
192 $ret.= '<input required="required" type="text" name="survey_title" value="'.$survey_title.'" size="60" maxlength="150" /></p>';
194 $ret.='<p><strong>'. _('Is Active?').'</strong>';
195 $ret.='<br /><input type="radio" name="is_active" value="1"' .$active. '/>'._('Yes');
196 $ret.='<br /><input type="radio" name="is_active" value="0"' .$inactive. '/>'._('No');
199 $arr_to_add = & $s->getAddableQuestionInstances();
200 $arr_to_del = & $s->getQuestionInstances();
202 if (count($arr_to_add)>0) {
203 $ret.='<h2>'. _('Addable Questions').'</h2>';
204 $title_arr[] = " ";
205 $title_arr[] = _('Questions');
206 $title_arr[] = " ";
207 $ret.=$GLOBALS['HTML']->listTableTop ($title_arr);
210 for($i = 0; $i < count($arr_to_add); $i++) {
212 if ($arr_to_add[$i]->isError()) {
213 echo $arr_to_add[$i]->getErrorMessage();
218 $ret.= "<tr ". $GLOBALS['HTML']->boxGetAltRowStyle($i) .">\n";
221 $ret.= '<td><input type="checkbox" name="to_add[]" value="'.$arr_to_add[$i]->getID().'" />'.
222 $arr_to_add[$i]->getQuestion().' ('.
223 $arr_to_add[$i]->getQuestionStringType().')</td>';
230 if (count($arr_to_add)>0) {
231 /* Fill the remain cells */
233 $ret.='<td> </td><td> </td></tr>';
235 $ret.='<td> </td></tr>';
238 $ret.= $GLOBALS['HTML']->listTableBottom();
241 /* Deletable questions */
242 if (count($arr_to_del) > 0) {
243 $ret.='<h2>'. _('Questions in this Survey').'</h2>';
244 $title_arr = array(_('Question'), _('Type'), _('Order'), _('Delete from this Survey'));
245 $ret.=$GLOBALS['HTML']->listTableTop ($title_arr);
248 for($i = 0; $i < count($arr_to_del); $i++) {
249 if ($arr_to_del[$i]->isError()) {
250 echo $arr_to_del[$i]->getErrorMessage();
254 $ret.= "<tr ". $GLOBALS['HTML']->boxGetAltRowStyle($i) .">\n";
256 $ret.= '<td>'.$arr_to_del[$i]->getID().'</td>';
257 $ret.= '<td>'.$arr_to_del[$i]->getQuestion().'</td>';
258 $ret.= '<td>'.$arr_to_del[$i]->getQuestionStringType().'</td>';
259 $ret.= '<td><center>['.util_make_link ('/survey/admin/survey.php?group_id='.$group_id.'&survey_id='. $survey_id.'&is_up=1&updown=Y'.'&question_id='.$arr_to_del[$i]->getID(),_('Up')).'] ';
260 $ret.= '['.util_make_link ('/survey/admin/survey.php?group_id='.$group_id.'&survey_id='. $survey_id.'&is_up=0&updown=Y'.'&question_id='.$arr_to_del[$i]->getID(),_('Down')).']</center></td>';
262 $ret.= '<td><center><input type="checkbox" name="to_del[]" value="'.$arr_to_del[$i]->getID().'" /></center></td>';
267 if (count($arr_to_del)) {
268 $ret.= $GLOBALS['HTML']->listTableBottom();
271 /* Privous style question input text box. deprecated.
272 $ret.= _('List question numbers, in desired order, separated by commas. <strong>Refer to your list of questions</strong> so you can view the question id\'s. Do <strong>not</strong> include spaces or end your list with a comma. <br />Ex: 1,2,3,4,5,6,7');
273 $ret.='<br /><input type="text" name="survey_questions" value="" length="90" maxlength="1500" /></p>';
276 $ret.='<p><input type="submit" name="submit" value="'.$survey_button.'" /></p>';
283 * Show list of questions
285 function showQuestions(&$questions) {
288 $n = count($questions);
289 $ret = "<h2>" . sprintf(ngettext("%d question found", "%d questions found", $n), $n)."</h2>";
291 /* Head information */
292 $title_arr = array('Question ID', 'Question', 'Type', 'Edit/Delete');
293 $ret.=$GLOBALS['HTML']->listTableTop ($title_arr);
295 for($i = 0; $i < count($questions); $i++) {
296 if ($questions[$i]->isError()) {
297 echo $questions[$i]->getErrorMessage();
301 $ret.= "<tr ". $GLOBALS['HTML']->boxGetAltRowStyle($i) .">\n";
302 $ret.= "<td><a href=\"question.php?group_id=$group_id&question_id=".
303 $questions[$i]->getID()."\">".$questions[$i]->getID()."</a></td>\n";
305 $ret.= '<td>'.$questions[$i]->getQuestion().'</td>';
306 $ret.= '<td>'.$questions[$i]->getQuestionStringType().'</td>';
308 /* Edit/Delete Link */
309 $ret.= "<td>[<a href=\"question.php?group_id=$group_id&question_id=".$questions[$i]->getID().'">';
310 $ret.= _('Edit').'</a>] ';
311 $ret.= "[<a href=\"question.php?delete=Y&group_id=$group_id&question_id=".$questions[$i]->getID().'">';
312 $ret.= _('Delete').'</a>]</td>';
316 $ret.= $GLOBALS['HTML']->listTableBottom();
321 * Show list of surveys
323 * Show surveys with many options
324 * have to set $user_id to get the right show_vote option
327 function showSurveys(&$surveys, $show_id=0, $show_questions=0,
328 $show_number_questions=0, $show_number_votes=0,
329 $show_vote=0, $show_edit=0, $show_result=0,
330 $show_result_graph=0, $show_result_comment=0,
339 /* Head information */
341 $title_arr[] = _('Survey ID');
344 $title_arr[] = _('Survey Title');
346 if ($show_questions) {
347 $title_arr[] = _('Questions');
349 if ($show_number_questions) {
350 $title_arr[] = _('Number of Questions');
352 if ($show_number_votes) {
353 $title_arr[] = _('Number of Votes');
355 if ($show_vote && $user_id) {
356 $title_arr[] = _('Did I Vote?');
359 $title_arr[] = _('Edit');
362 $title_arr[] = _('Result');
364 if ($show_result_graph) {
365 $title_arr[] = _('Result with Graph');
367 if ($show_result_comment) {
368 $title_arr[] = _('Result with Graph and Comments');
370 if ($show_result_csv) {
371 $title_arr[] = _("CSV");
374 $ret.=$GLOBALS['HTML']->listTableTop ($title_arr);
376 /* Color index for table */
378 for($i = 0; $i < count($surveys); $i++) {
379 if ($surveys[$i]->isError()) {
380 echo $surveys[$i]->getErrorMessage();
384 if (!$surveys[$i]->isActive()) {
385 if ($show_inactive) {
386 $strike_open="<strike>";
387 $strike_close="</strike>";
399 $ret.= "<tr ". $GLOBALS['HTML']->boxGetAltRowStyle($color_index++) .">\n";
401 $ret.= '<td>'.$surveys[$i]->getID().'</td>';
404 $ret.= '<td>'.$strike_open.util_make_link ('/survey/survey.php?group_id='.$group_id.'&survey_id='. $surveys[$i]->getID(), $surveys[$i]->getTitle()). $strike_close.'</td>';
406 if ($show_questions) {
407 // add a space after comma
408 $ret.= '<td>'.str_replace(",", ", ", $surveys[$i]->getQuestionString()).'</td>';
410 if ($show_number_questions) {
411 $ret.= '<td>'.$surveys[$i]->getNumberOfQuestions().'</td>';
413 if ($show_number_votes) {
414 $ret.= '<td>'.$surveys[$i]->getNumberOfVotes().'</td>';
416 if ($show_vote && $user_id) {
417 if ($surveys[$i]->isUserVote($user_id)) {
418 $ret.='<td>'. _('Yes') . '</td>';
420 $ret.='<td>'. _('No') . '</td>';
424 /* Edit/Delete Link */
425 $ret.= '<td>['.util_make_link ('/survey/admin/survey.php?group_id='.$group_id.'&survey_id='. $surveys[$i]->getID(),_('Edit')).'] ';
427 /* We don't support delete yet. Need to delete all results as well */
429 $ret.= '['.util_make_link ('/survey/admin/survey.php?delete=Y&group_id='.$group_id.'&survey_id='. $surveys[$i]->getID(),_('Delete')).']';
434 /* Edit/Delete Link */
435 $ret.= '<td>['.util_make_link ('/survey/admin/show_results.php?group_id='.$group_id.'&survey_id='. $surveys[$i]->getID(),_('Result')).']</td>';
437 if ($show_result_graph) {
438 /* Edit/Delete Link */
439 $ret.= '<td>['.util_make_link ('/survey/admin/show_results.php?graph=yes&group_id='.$group_id.'&survey_id='. $surveys[$i]->getID(),_('Result with Graph')).']</td>';
441 if ($show_result_comment) {
442 /* Edit/Delete Link */
443 $ret.= '<td>['.util_make_link ('/survey/admin/show_results.php?graph=yes&show_comment=yes&group_id='.$group_id.'&survey_id='.$surveys[$i]->getID(),_('Result with Graph and Comments')).']</td>';
445 if ($show_result_csv) {
447 $ret.= "<td>[<a href=\"/survey/admin/show_csv.php?group_id=$group_id&survey_id=".$surveys[$i]->getID().'">';
448 $ret.= _("CSV").'</a>]</td>';
453 $ret.= $GLOBALS['HTML']->listTableBottom();
454 if ($displaycount == 0) {
455 return '<p class="information">' . (_('No Survey is found')) . '</p>';
461 * Show survey form - Show all forums of Survey
463 function showSurveyForm( &$s ) {
467 if (!$s->isActive()) {
468 return '<div class="error">'. _('Error: you cannot vote for inactive survey').'</div>';
470 /* Get questions of this survey */
471 $questions = & $s->getQuestionInstances();
474 if ($s->isUserVote(user_getid())) {
475 $ret.= '<p class="warning_msg">'. _('Warning - you are about to vote a second time on this survey.').'</p>';
477 $ret.= '<form action="/survey/survey_resp.php" method="post">'.
478 '<input type="hidden" name="group_id" value="'.$group_id.'" />'.
479 '<input type="hidden" name="survey_id" value="'.$survey_id. '" />';
483 /* Keep question numbers */
485 $last_question_type = "";
486 for($i = 0; $i < count($questions); $i++) {
487 if ($questions[$i]->isError()) {
488 echo $questions[$i]->getErrorMessage();
491 $question_type = $questions[$i]->getQuestionType();
492 $question_id = $questions[$i]->getID();
493 $question_title = stripslashes($questions[$i]->getQuestion());
495 if ($question_type == '4') {
496 /* Don't show question number if it's just a comment */
497 $ret.='<tr><td class="top"> </td><td>';
499 $ret.= '<tr><td class="top"><strong>';
500 /* If it's a 1-5 question box and first in series, move Quest number down a bit */
501 if (($question_type != $last_question_type) && (($question_type == '1') || ($question_type == '3'))) {
502 $ret.= ' <br />';
505 $ret.= $index++.' <br /></strong></td><td>';
508 switch($question_type) {
509 case 1: /* This is a radio-button question. Values 1-5.
510 Show the 1-5 markers only if this is the first in a series */
511 if ($question_type != $last_question_type) {
512 $ret.=' <strong>1</strong>'._('Low').
513 ' <strong>5</strong>' .
517 for ($j=1; $j<=5; $j++) {
518 $ret.= '<input type="radio" name="_'.$question_id.'" value="'.$j.'" />';
521 $ret.= ' '.$question_title;
524 case 2: /* This is a text-area question. */
525 $ret.= $question_title.'<br />';
526 $ret.='<textarea name="_'.$question_id.'" rows="5" cols="60"></textarea>';
528 case 3: /* This is a Yes/No question.
529 Show the Yes/No only if this is the first in a series */
530 if ($question_type != $last_question_type) {
531 $ret.= '<strong>Yes / No</strong><br />';
534 $ret.='<input type="radio" name="_'.$question_id.'" value="1" />';
535 $ret.='<input type="radio" name="_'.$question_id.'" value="5" />';
536 $ret.=' '.$question_title;
538 case 4: /* This is a comment only. */
539 $ret.= ' <br /><strong>'.util_make_links($question_title).'</strong>';
540 $ret.= '<input type="hidden" name="_'.$question_id.'" value="-666" />';
542 case 5: /* This is a text-field question. */
543 $ret.= $question_title. '<br />';
544 $ret.= '<input type="text" name="_'.$question_id.'" size="20" maxlength="70" />';
547 $ret.= $question_title. '<br />';
551 $last_question_type=$question_type;
554 $ret.='<tr><td class="align-center" colspan="2">'.
555 '<input type="submit" name="submit" value="'._('Submit').'" />'.
556 '<br />'.util_make_link ('/survey/privacy.php?group_id='.$group_id,_('Survey Privacy')).
557 '</td></tr></form></table>';
565 * @param Object a Survey Response Factory
567 function showResult( &$sr, $show_comment=0, $q_num="", $show_graph=0) {
570 $Survey = $sr->getSurvey();
571 $Question = $sr->getQuestion();
575 $ret.= $q_num . '. ';
578 $ret.=$Question->getQuestion().'</strong><br />';
579 $results = $sr->getResults();
581 echo ($sr->getErrorMessage());
584 $totalCount = $sr->getNumberOfSurveyResponses();
585 $votes = $Survey->getNumberOfVotes();
587 /* No votes, no result to show */
589 $ret.= '<ul><li>'._('No Votes').'</li></ul>';
593 switch($Question->getQuestionType()) {
594 case 1: /* This is a radio-button question. Values 1-5.
595 Show the 1-5 markers only if this is the first in a series */
596 $arr_name=array('No Answer', 'Low 1', '2', '3', '4', 'High 5', 'No Answer');
597 $arr_color=array('black', 'red', 'blue', 'yellow', 'green', 'brown', 'black');
598 $results[0] = $votes - $results[1] - $results[2] - $results[3] - $results[4] - $results[5];
601 for ($j=5; $j>=0; $j--) {
602 $percent = sprintf("%02.1f%%", (float)$results[$j]*100/$votes);
603 $legendArr[] = $arr_name[$j].' ('. $percent.')';
604 $valuesArr[] = $results[$j];
606 $ret.= $this->drawGraph($Question->getID(), 'hbar', $legendArr, $valuesArr);
608 $ret.= '<table style="padding-left: 3em" width="100%">';
610 for ($j=5; $j>=0; $j--) {
611 $percent = (float)$results[$j]*100/$votes;
612 $ret.= $this->_makeBar($arr_name[$j].' ('.$results[$j].')', $percent, $arr_color[$j]);
619 case 3: /* This is a Yes/No question. */
621 $arr_name=array('', 'YES', 'NO', 'No Answer');
622 $arr_color=array('', 'red', 'blue', 'black');
624 $res[1] = $results[1]; /* Yes */
625 $res[2] = $results[5]; /* No */
626 $res[3] = $votes - $res[1] -$res[2];
629 for ($j=1; $j<=3; $j++) {
630 $legendArr[] = $arr_name[$j].'('.$res[$j].')';
631 $valuesArr[] = $res[$j];
633 $ret.= $this->drawGraph($Question->getID(), 'pie', $legendArr, $valuesArr);
635 $ret.= '<table style="padding-left: 3em" width="100%">';
636 for ($j=1; $j<=3; $j++) {
637 $result_per[$j] = (float)$res[$j]*100/$votes;
638 $ret.= $this->_makeBar($arr_name[$j].' ('.$res[$j].')', $result_per[$j], $arr_color[$j]);
645 case 4: /* This is a comment only. */
648 case 2: /* This is a text-area question. */
649 case 5: /* This is a text-field question. */
651 for($j=0; $j<$totalCount; $j++) {
652 $ret.='<hr /><strong>'._('Comments').
653 ' # '.($j+1).'/'.$totalCount. '</strong><p/>';
655 $words = explode(" ",$results[$j]);
657 //print 100 chars in words per line
658 foreach ($words as $word) {
659 // if we have a stupidly strange word with lots of letters, we'll make a new line for it and split it
660 if ( (strlen($word)>100) && ((strlen($word)+$linelength)>100)) {
661 $chunks = $this->split_str($word,50);
662 foreach ($chunks as $chunk) {
668 $linelength += strlen($word);
669 if ($linelength>100) {
680 $ret.='<ul><li><a href="show_results.php?survey_id='.$Survey->getID().
681 '&question_id='.$Question->getID().
682 '&group_id='.$group_id.'">'.
683 sprintf(ngettext('View All %1$s Comment', 'View All %1$s Comments', $totalCount), $totalCount).
696 * split_str - works as str_split of PHP5 - Converts a string to an array.
699 * @param int length of chunk
700 * @return array array of chunks of the string
702 function split_str($str,$split_lengt=1) {
704 for ($i=0;$i<$cnt;$i+=$split_lengt) {
705 $rslt[]= substr($str,$i,$split_lengt);
711 * _makeBar - make Precentage bar as a cell in a table. Starts with <tr> and ends with </tr>
713 * @param String name Name
714 * @param int percentage of the name
717 function _makeBar($name, $percent, $color) {
718 $ret = '<tr><td width="30%">'.$name.'</td><td>';
719 $ret.= '<table width="'.$percent.'%"><tr>';
721 $ret.='<td width="90%" bgcolor="'.$color.'"> </td>';
724 $ret.= '<td>'.sprintf("%.2f", $percent).'%</td></tr></table></td></tr>'."\n";
729 function drawGraph($id, $graphType, $legend, $values) {
732 $ret = '<script type="text/javascript">//<![CDATA['."\n";
733 $ret .= 'var data'.$id.' = new Array();';
734 $ret .= 'var plot'.$id.';';
735 for ($i = 0; $i < count($values); $i++) {
736 $ret .= 'data'.$id.'.push([\''.htmlentities($legend[$i]).'\','.$values[$i].']);';
738 $ret .= 'jQuery(document).ready(function(){
739 plot'.$id.' = jQuery.jqplot (\'chart'.$id.'\', [data'.$id.'],
742 renderer: jQuery.jqplot.PieRenderer,
744 showDataLabels: true,
745 dataLabels: \'percent\',
749 show:true, location: \'e\',
753 $ret .= 'jQuery(window).resize(function() {
754 plot'.$id.'.replot( { resetAxes: true } );
756 $ret .= '//]]></script>';
757 $ret .= '<div id="chart'.$id.'"></div>';
761 $ret = '<script type="text/javascript">//<![CDATA['."\n";
762 $ret .= 'var data'.$id.' = new Array();';
763 $ret .= 'var ticks'.$id.' = new Array();';
764 $ret .= 'var plot'.$id.';';
766 for ($i = 0; $i < count($values); $i++) {
767 $ret .= 'data'.$id.'.push(['.$values[$i].']);';
768 if ($yMax < $values[$i]) {
771 $ret .= 'ticks'.$id.'.push([\''.htmlentities($legend[$i]).'\']);';
773 $ret .= 'jQuery(document).ready(function(){
774 plot'.$id.' = jQuery.jqplot (\'chart'.$id.'\', data'.$id.',
777 tickRenderer: jQuery.jqplot.CanvasAxisTickRenderer,
790 renderer:jQuery.jqplot.BarRenderer,
797 renderer: jQuery.jqplot.CategoryAxisRenderer,
818 $ret .= 'jQuery(window).resize(function() {
819 plot'.$id.'.replot( { resetAxes: true } );
821 $ret .= '//]]></script>';
822 $ret .= '<div id="chart'.$id.'"></div>';
831 // c-file-style: "bsd"