I tried to show values that are in a div with a document.getElementById("valor")
. I used alert();
command to show what it would bring and it showed in the objectHTMLDivElement
window how can I show this?
JavaScript
$(document).ready(function () {
var x = document.getElementById("valor");
var text = "";
alert(x);
var data = [text];
var tooltips = [];
var line = new RGraph.Line({
id: 'cvs',
data: data,
options: {
tooltips: {
self: tooltips,
highlight: false
},
colors: ['#058DC7'],
filled: true,
fillstyle: 'rgba(229,243,249,0.5)',
tickmarks: 'filledcircle',
background: {
grid: {
vlines: false,
border: false,
autofit: {
numhlines: 10
}
}
},
shadow: false,
linewidth: 3,
gutter: {
left: 50,
right: 20
},
numxticks: 0,
ylabels: {
count: 5
},
axis: {
color: '#aaa'
},
text: {
color: '#aaa'
},
labels: ['21/01', '22/01', '23/01', '24/01', '25/01']
}
})
RGraph.ISOLD ? line.draw() : line.trace2();
})
HTML
<html>
<head>
<link rel="stylesheet" href="demos.css" type="text/css" media="screen" />
<script src="/sistema/jquery/plugins/RGraph/libraries/RGraph.common.core.js"></script>
<script src="/sistema/jquery/plugins/RGraph/libraries/RGraph.common.dynamic.js"></script>
<script src="/sistema/jquery/plugins/RGraph/libraries/RGraph.common.tooltips.js"></script>
<script src="/sistema/jquery/plugins/RGraph/libraries/RGraph.line.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script><scripttype="text/javascript" src="http://www.google.com/jsapi"></script><scripttype="text/javascript">
google.load("jquery", "1.3.2", {
uncompressed: true
});
</script>
<script type="text/javascript" src="json.class.js"></script>
<!--[if lt IE 9]>
<script src="../excanvas/excanvas.js"></script>
<![endif]-->
<p style="margin-left:50em;">
<title>Cotação USD x BRL</title>
</p>
<meta name="robots" content="noindex,nofollow" />
<meta name="Descrição" content="Cotação do Dolar de Acordo com o Real" />
</head>
<body>
<h2></h2>
<canvas id="cvs" width="900" height="300">[No canvas support]</canvas>
<div id="valor"></div>
<div id="label"></div>
</body>
</html>