Dear all,
I need to rapresent a pin value by a very simple “graph bar level” on a web page.
I’m tryng to use the API address "http://blynk-cloud.com/xxxxxxxxxxxxxxxxxxxxxxx/get/V2 and as result I obtain this value: [“1.646”]
In wich way is possible to display a simple bar level? I’m trying with JSON, but with no good results…
I’m using this code based on “Anychart core” but I need to replace the var “data” with the value of my API address (1.646 in eg)
:
<html>
<head>
<script src="anychart-core.min.js"></script>
<script src="anychart-cartesian.min.js"></script>
</head>
<body>
<div id="container">
<script>
anychart.onDocumentLoad(function() {
//create the data
var data = [
{x: 'Geiger', y: 1},
{x: 'DZone', y: 0.60},
{x: 'Gizmodo', y: 0.30},
{x: 'StackOverFlow', y: 0.80},
{x: 'CNET', y: 0.50}
];
var chart = anychart.bar(); //create a chart
chart.title('Website Traffic Stats');//create title for the chart
chart.xAxis().title("Website");//create name for X axis
chart.yAxis().title("Traffic Per Minute"); //create name for Y axis
var series = chart.bar(data); //create bar series and pass data
chart.container("container"); //reference the container Id
chart.draw(); //initiate drawing the bar chart
});
</script>
</div>
</body>
</html>