i have a question regarding passing the Content of a PHP Variable to a getJson Request. My Current Code looks like this
<script type="text/javascript">
window.onload = function () {
var tool = <?php echo $_REQUEST['tool']; ?>;
$.getJSON("fertigung/graph/mes/autocomplete/getdata_error_vs_error_category.php?type=json", { tool: $tool }, function(data) {
var dataPoints = [];
var chart = new CanvasJS.Chart("chartContainer",{
animationEnabled: true,
animationDuration: 2000,
exportEnabled: true,
zoomEnabled: true,
title:{
fontSize: 15,
text:"Number of Fails vs. Diagnostic Part"
},
axisX: {
interval:1,
labelMaxWidth: 300,
labelAngle: 45,
labelFontSize: 12,
labelFontFamily: "tahoma",
},
axisY: {
title: "Number of Failed Diagnostics",
labelMaxWidth: 300,
labelFontSize: 12,
labelFontFamily: "tahoma",
},
data: [{
type: "column",
dataPoints : data,
}]
});
chart.render();});
}
</script>
The target is to handover the Content of var tool to the getjson page.
Big Thanks in advance for your help.
Best Regards
Paradoxs