1

I have a lokal HTML file using teechart HTML 5 (testing it) , and would like to get the Data from a remote server , is it possible ?

I am trying to do something like this:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<title>Graf</title>
</head>
<!--[if lt IE 9]>
  <script src="./js/excanvas/excanvas_text.js"></script>   
  <script src="./js/excanvas/canvas.text.js"></script>
<![endif]-->
<script src="./js/teechart.js" type="text/javascript">
</script>
<script src="./js/teechart-extras.js" type="text/javascript"></script>
<script src="./js/teechart-table.js"></script>
<script language="JavaScript">
<!--
function draw() {
  var Chart1=new Tee.Chart("canvas");
  var b=Chart1.addSeries(new Tee.Bar());
  b.loadXML("http://www.myserver.com/xml/graf.xml"); 
  Chart1.draw(); 
}
//-->
</script>
<BODY onload="draw()">
<canvas id="canvas" width="1000" height="400"></canvas>
</html>

The graph is drawn but the content in graf.xml is not shown , is it possible ?

graf.xml:

<series name="Friends" color="Blue" metric="Quantity">
  <point name="Facebook" value="123"/>
  <point name="Twitter" value="456"/>
  <point name="Google+" value="789"/>
</series>
Yeray
  • 5,009
  • 1
  • 13
  • 25
bsw
  • 153
  • 13

1 Answers1

0

I've made a simple example getting an xml from the same server:

http://www.steema.com/files/public/teechart/html5/latest/demos/sources/FromXMLURL.htm

Yeray
  • 5,009
  • 1
  • 13
  • 25
  • Thanks, so it means my plan to load the xml from another site its not possible ? – bsw May 14 '15 at 19:06
  • I can't try it at the moment, but I believe the same code should work on a different server if [CORS](http://enable-cors.org/index.html) is active on it. [Here](http://www.html5rocks.com/en/tutorials/cors/#toc-adding-cors-support-to-the-server) it is a guide about it. – Yeray May 18 '15 at 09:22