Skip to content

Commit

Permalink
fixed plot graph not working (#1396)
Browse files Browse the repository at this point in the history
  • Loading branch information
muarachmann authored and aethelwulffe committed Feb 1, 2019
1 parent 893902f commit f016374
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
11 changes: 7 additions & 4 deletions interface/forms/track_anything/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ function ta_report_plot_graph(formid,ofc_name,the_track_name,ofc_date,ofc_value)
var thetrack = JSON.stringify(the_track_name + " [Track " + formid + "]");
var thedates = JSON.stringify(ofc_date);
var thevalues = JSON.stringify(ofc_value);
$.ajax({ url: '<?php echo $modules_dir; ?>openflashchart/graph_track_anything.php',

jQuery.ajax({ url: '../../../modules/openflashchart/graph_track_anything.php',
type: 'POST',
data: { dates: thedates,
values: thevalues,
Expand All @@ -73,15 +73,18 @@ function ta_report_plot_graph(formid,ofc_name,the_track_name,ofc_date,ofc_value)
// ofc will look after a variable named "ofc"
// inside of the flashvars
// However, we need to set both
// data and flashvars.ofc
// data and flashvars.ofc
data=returnData;
flashvars.ofc = returnData;
// call ofc with proper falshchart
swfobject.embedSWF('<?php echo $modules_dir; ?>openflashchart/open-flash-chart.swf',
swfobject.embedSWF('../../../modules/openflashchart/open-flash-chart.swf',
"graph" + formid, "650", "200", "9.0.0","",flashvars);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.responseText);
console.log(textStatus);
console.log(XMLHttpRequest);
console.log(errorThrown);
//alert("XMLHttpRequest="+XMLHttpRequest.responseText+"\ntextStatus="+textStatus+"\nerrorThrown="+errorThrown);
}

Expand Down
4 changes: 2 additions & 2 deletions interface/patient_file/encounter/forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
?>

<?php // include generic js support for graphing ?>
<script type="text/javascript" src="<?php echo $modules_dir; ?>openflashchart/js/json/json2.js"></script>
<script type="text/javascript" src="<?php echo $modules_dir; ?>openflashchart/js/swfobject.js"></script>
<script type="text/javascript" src="<?php echo $GLOBALS['web_root']?>/modules/openflashchart/js/json/json2.js"></script>
<script type="text/javascript" src="<?php echo $GLOBALS['web_root']?>/modules/openflashchart/js/swfobject.js"></script>

<?php // if the track_anything form exists, then include the styling and js functions for graphing
if (file_exists(dirname(__FILE__) . "/../../forms/track_anything/style.css")) { ?>
Expand Down
4 changes: 2 additions & 2 deletions modules/openflashchart/graph_track_anything.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
$fake_register_globals=false;
//

require_once(dirname(__FILE__) . "/../../interface/globals.php");
require_once($GLOBALS['srcdir'] . "/openflashchart/php-ofc-library/open-flash-chart.php");
require_once("../../interface/globals.php");
require_once($modules_dir. "/openflashchart/php-ofc-library/open-flash-chart.php");
require_once($GLOBALS['srcdir'] . "/formdata.inc.php");

// get $_POSTed data
Expand Down

0 comments on commit f016374

Please sign in to comment.