Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > it.comp.lang.javascript > #8163
| From | Enrico Maria Chellini <bitit@bitit.it> |
|---|---|
| Newsgroups | it.comp.lang.javascript |
| Subject | ajax mi blocca canvas |
| Date | 2017-01-02 20:03 +0100 |
| Organization | www.bitit.it |
| Message-ID | <o4e85k$112f$1@gioia.aioe.org> (permalink) |
ho una pagina dove genero dei grafici:
se la metto in included PHP non mi da nessun problema, ma se la faccio
rigenerare mi viene richiamata da uno script ajax.
<script>
$(document).ready(function() {
setInterval(function(){getUpdates()}, 2000);
});
function getUpdates() {
$("#cbox").load("chart.php");
}
</script>
non mi da output.
questa รจ la pagina, consigli?:
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript">
window.onload = function () {
var chart = new
CanvasJS.Chart("chartContainer", {
title: {
text: "Site Traffic",
fontSize: 30
},
animationEnabled: true,
axisX: {
gridColor: "Silver",
tickColor: "silver",
valueFormatString:
"DD/MMM"
},
toolTip: {
shared: true
},
theme: "theme2",
axisY: {
gridColor: "Silver",
tickColor: "silver"
},
legend: {
verticalAlign:
"center",
horizontalAlign:
"right"
},
axisY:{
stripLines:[
{
value:200,
color: "red"
}
]
},
data: [
{
type: "line",
showInLegend: true,
lineThickness: 2,
name: "Visits",
markerType: "square",
color: "#F08080",
dataPoints: [
{ x: new Date(2010,
0, 3), y: 650 },
{ x: new Date(2010,
0, 5), y: 700 },
{ x: new Date(2010,
0, 7), y: 710 },
{ x: new Date(2010,
0, 9), y: 658 },
{ x: new Date(2010,
0, 11), y: 734 },
{ x: new Date(2010,
0, 13), y: 963 },
{ x: new Date(2010,
0, 15), y: 847 },
{ x: new Date(2010,
0, 17), y: 853 },
{ x: new Date(2010,
0, 19), y: 869 },
{ x: new Date(2010,
0, 21), y: 943 },
{ x: new Date(2010,
0, 23), y: 970 }
]
},
{
type: "line",
showInLegend: true,
name: "Unique
Visits",
color: "#20B2AA",
lineThickness: 2,
dataPoints: [
{ x: new Date(2010,
0, 3), y: 510 },
{ x: new Date(2010,
0, 5), y: 560 },
{ x: new Date(2010,
0, 7), y: 540 },
{ x: new Date(2010,
0, 9), y: 558 },
{ x: new Date(2010,
0, 11), y: 544 },
{ x: new Date(2010,
0, 13), y: 693 },
{ x: new Date(2010,
0, 15), y: 657 },
{ x: new Date(2010,
0, 17), y: 663 },
{ x: new Date(2010,
0, 19), y: 639 },
{ x: new Date(2010,
0, 21), y: 673 },
{ x: new Date(2010,
0, 23), y: 660 }
]
},
{
type: "line",
showInLegend: true,
name: "Unique
Visits",
color: "#20B2AA",
lineThickness: 2,
dataPoints: [
{ x: new Date(2010,
0, 3), y: 510 },
{ x: new Date(2010,
0, 5), y: 560 },
{ x: new Date(2010,
0, 7), y: 300 },
{ x: new Date(2010,
0, 9), y: 250 },
{ x: new Date(2010,
0, 11), y: 300 },
{ x: new Date(2010,
0, 13), y: 693 },
{ x: new Date(2010,
0, 15), y: 657 },
{ x: new Date(2010,
0, 17), y: 663 },
{ x: new Date(2010,
0, 19), y: 639 },
{ x: new Date(2010,
0, 21), y: 673 },
{ x: new Date(2010,
0, 23), y: 660 }
]
}
],
legend: {
cursor: "pointer",
itemclick: function
(e) {
if (typeof
(e.dataSeries.visible) === "undefined" || e.dataSeries.visible) {
e.dataSeries.visible = false;
}
else {
e.dataSeries.visible = true;
}
chart.render();
}
}
});
chart.render();
}
</script>
<script src="js/canvas/canvasjs.min.js"></script>
<title>CanvasJS Example</title>
</head>
<body>
<div id="chartContainer" style="height: 400px; width: 100%;">
</div>
</body>
</html>
Back to it.comp.lang.javascript | Previous | Next — Next in thread | Find similar
ajax mi blocca canvas Enrico Maria Chellini <bitit@bitit.it> - 2017-01-02 20:03 +0100
Re: ajax mi blocca canvas Alessandro Pellizzari <shuriken@amiran.it> - 2017-01-03 07:56 +0000
Re: ajax mi blocca canvas Enrico Maria Chellini <bitit@bitit.it> - 2017-01-03 10:23 +0100
Re: ajax mi blocca canvas Alessandro Pellizzari <shuriken@amiran.it> - 2017-01-03 13:28 +0000
Re: ajax mi blocca canvas gobitit@gmail.com - 2017-01-04 06:30 -0800
csiph-web