Welcome aboard! We are happy you are here and wish you good net-raft!
<?php
$dataPoints = array(
array("y" => 1330, "label" => "2013"),
array("y" => 2500, "label" => "2014"),
array("y" => 1450, "label" => "2015"),
array("y" => 3256, "label" => "2016"),
array("y" => 4500, "label" => "2017"),
array("y" => 2500, "label" => "2018")
);
$dataPoints2 = array(
array("y" => 1360, "label" => "2013"),
array("y" => 2570, "label" => "2014"),
array("y" => 1480, "label" => "2015"),
array("y" => 3600, "label" => "2016"),
array("y" => 3530, "label" => "2017"),
array("y" => 2123, "label" => "2018")
);
?>
<!DOCTYPE HTML>
<html>
<head>
<script>
window.onload = function () {
var chart = new CanvasJS.Chart("chartContainer", {
title: {
text: "Your text"
},
axisY: {
title: "Your title"
},
axisY2: {
title: "Your title"
},
data: [{
type: "line",
yValueFormatString: "$##0.00",
dataPoints: <?php echo json_encode($dataPoints, JSON_NUMERIC_CHECK); ?>
},
{
type: "line",
yValueFormatString: "$##0.00",
dataPoints: <?php echo json_encode($dataPoints2, JSON_NUMERIC_CHECK); ?>
}]
});
chart.render();
}
</script>
</head>
<body>
<div id="chartContainer" style="height: 370px; width: 100%;"></div>
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
</body>
</html>
The most helpful PHP solutions
detect browser phpPHP
Click to see more ...
4.8K
408
create QR code phpPHP
Click to see more ...
3.2K
289
create relative date phpPHP
Click to see more ...
2.3K
264
drag and drop upload file using phpPHP
Click to see more ...
2.9K
253
delete array item phpPHP
Click to see more ...
2.6K
245
detect ie phpPHP
Click to see more ...
1.7K
213
detect speed internet phpPHP
Click to see more ...
1.8K
198
get current url phpPHP
Click to see more ...
2K
197
get meta tag phpPHP
Click to see more ...
1.6K
193
Get real client country using php ?PHP
Click to see more ...
1.6K
181