Đang chuẩn bị liên kết để tải về tài liệu:
Publishing AJAX and PHP - part 20
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
AJAX Real-Time Charting with SVG For a primer on the world of SVG, check out these resources: • • • • • • The SVG W3C page at http://www.w3.org/Graphics/SVG/. An SVG introduction at http://www.w3schools.com/svg/svg_intro.asp. A very useful list of SVG links at http://www.svgi.org/. A handy SVG reference at http://www.w3schools.com/svg/svg_reference.asp. The SVG document structure is explained at http://www.w3.org/TR/SVG/struct.html. SVG examples at http://www.carto.net/papers/svg/samples/ and http://svgwhiz.com/samples.html. Implementing a Real-Time Chart with AJAX and SVG Before continuing, please make sure your web browser supports SVG. The code in this case study has been tested with Firefox 1.5, Internet Explorer with the Adobe SVG Viewer, and Apache Batik | AJAX Real-Time Charting with SVG For a primer on the world of SVG check out these resources The SVG W3C page at http www.w3.org Graphics SVG . An SVG introduction at http www.w3schools. com svg svg_intro.asp. A very useful list of SVG links at http www.svgi.org . A handy SVG reference at http www.w3schools. com svg svg_reference .asp. The SVG document structure is explained at http www.w3.org TR SVG struct.html. SVG examples at http www.carto.net papers svg samples and http svg-whiz.com samples .html. Implementing a Real-Time Chart with AJAX and SVG Before continuing please make sure your web browser supports SVG. The code in this case study has been tested with Firefox 1.5 Internet Explorer with the Adobe SVG Viewer and Apache Batik. You can test the online demo accessing the link you can find at http ajaxphp.packtpub.com. Firefox ships with integrated SVG support. Being at its first version this SVG implementation does have some problems that you need to take into consideration when writing the code and the performance isn t excellent. To load SVG in Internet Explorer you need to install an external SVG plug-in. The SVG plug-in we used in our tests is the one from Adobe which you can download at http www .adobe.com svg viewer i nstall mai n.html. The installation process is very simple you just need to download a small file named SVGView.exe and execute it. The first time you load an SVG page you will be asked to confirm the terms of agreement. Finally we also tested the application with Apache s Batik SVG viewer in which case you need to load the svg file directly because it doesn t support loading the HTML file that loads the SVG script. Y ou may want to check Batik for its good DOM viewer which nicely displays the SVG nodes in a hierarchical structure. In this chapter s case study we ll create a simple chart application whose input data is retrieved asynchronously from a PHP script. The generated data can be anything and in our case we ll have a simple .