Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Cannot display Line Graph Topic is solved

Questions related to using nuBuilder Forte.
Post Reply
nadir
Posts: 44
Joined: Mon Apr 21, 2025 7:03 am
Has thanked: 5 times
Been thanked: 4 times

Cannot display Line Graph

Unread post 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
kev1n
nuBuilder Team
Posts: 4428
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 475 times
Contact:

Re: Cannot display Line Graph

Unread post 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.
nadir
Posts: 44
Joined: Mon Apr 21, 2025 7:03 am
Has thanked: 5 times
Been thanked: 4 times

Re: Cannot display Line Graph

Unread post by nadir »

That fixed the problem. The chart is displaying now. Thanks
Post Reply