Page 1 of 1

Cannot display Line Graph

Posted: Thu Jul 24, 2025 8:05 am
by nadir
Hi. After I updated nuBuilder to latest version, the chart object stopped working. The chart no longer displays. I am using following code in "Before Edit":

Code: Select all

$select = "SELECT percentage, (FROM_UNIXTIME(scores.timestamp, '%d-%m-%Y')) as test_date FROM scores, procedures WHERE scores.procedure_id=procedures.procedures_id AND user_id = '#user_filter#' AND category = '#choice#' ORDER BY timestamp ASC;";
$stmt = nuRunQuery($select);

$count = 0;
$data = "window.googleChartsData = [['Test Date', 'Percentage'],";
while($row = db_fetch_object($stmt)) {
    $data .= "['" . $row->test_date . "', ". $row->percentage . "],";
    $count++;
}

$data .= "];";

if ($count == 0)
  $data = "window.googleChartsData = []";


nuAddJavaScript($data);
I set the JavaScript array field to window.googleChartsData.

No errors are reported in the nuBuilder debugger and the browser's JavaScript console

Re: Cannot display Line Graph

Posted: Thu Jul 24, 2025 9:01 am
by kev1n
Hi,

Edit nuform.js, search for 'html': nuHTML,, add 'chart': nuHTML, after that line, save the changes, restart your browser and test again.

Re: Cannot display Line Graph

Posted: Thu Jul 24, 2025 9:21 am
by nadir
That fixed the problem. The chart is displaying now. Thanks