Polychart / polychart.js

http://polychart.com
86 stars 17 forks source link

Standalone example #3

Closed kimtang closed 11 years ago

kimtang commented 11 years ago

Hi everyone,

i made a standalone example for myself.

But unfortunately the page is not running on firefox. The error code is:

[14:07:20.978] uncaught exception: Error Code #212: Invalid dom for .opts('dom') - #chart1

If you want to recreate the issue, the code is below.

thx, kim

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Standalone example using polychart</title>
    <script type="text/javascript" src="../../polychart/polychart.0.1.0.js"></script>
</head>
<body>
    <script type="text/javascript">

        var data = { 'A': [0, 1, 2, 3, 4], 'B': [0, 1, 4, 9, 16] };

        gg.graph(data)
         .layer(gg.layer.line().map('x', 'A').map('y', 'B'))
         .opts('title', 'A Line Chart')
         .opts('width', 267).opts('height', 260)
         .render('#chart1');

        gg.graph(data)
         .layer(gg.layer.bar().map('x', 'A').map('y', 'B'))
         .scale('x', 'discrete')
         .opts('title', 'A Bar Chart')
         .opts('width', 267).opts('height', 260)
         .render('#chart2');

    </script>
</body>
</html>
sthagen commented 11 years ago

I suggest to close this issue.

Details: In v1.0.0 on OS X with recent firefox all is well

Remark to the OP: I suggest to insert some containers with the ids chart1 and chart2 into your sample html to make the graphs actually appear on the page displayed ;-) like eg.

   <div id="chart2"/><div id="chart1"/>