Embedding Dygraphs in html

I draw some csv data using the java applet built into my simple html code. Everything works fine when I draw data without any frills; if I add tags and a title, I no longer see the graphs. What should I change in the html code reported below?

<html>
    <head>
        <script type="text/javascript"
            src="dygraph-combined.js"></script>
    </head>
    <body>
        <div id="graphdiv"
            style="width:1000px; height:600px;"></div><br>
        <script type="text/javascript">
            g2 = new Dygraph(
                             document.getElementById("graphdiv"),
                             "combined_file.csv", // path to CSV file
                             {  title: 'Title',
                                xlabel: 'Time'
                                ylabel: 'Space',
                                legend: 'always',
                                labelsDivStyles: {'textAlign': 'right'},
                             });
            </script>
    </body>
</html>

For the parameters of the construction of drawings, I performed this example.

0
source share
1 answer

You forgot the comma after the xlabel property. It should be like this:

{  title: 'Title',
   xlabel: 'Time',
   ylabel: 'Space',
   legend: 'always',
   labelsDivStyles: {'textAlign': 'right'},
});

javascript, . , - . javascript.

+1

All Articles