Kaha
Kaha

Reputation: 171

Why any of highcharts demo example doesn't work?

I'm trying to use highcharts example. But it doesn't work, I cannot understand, have I missed something?

<!DOCTYPE HTML><html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Highcharts Example</title>

</head>

<body>

    <h1>Highcharts example</h1>
    <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>


    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>

    <script type="text/javascript" src="http://code.highcharts.com/highcharts.js"></script>
    <script type="text/javascript" src="http://code.highcharts.com/modules/exporting.js"></script>   


    <script type="text/javascript">
        $(function () {
            $('#container').highcharts({
                chart: {
                    type: 'column'
                },
                title: {
                    text: 'Column chart with negative values'
                },
                xAxis: {
                    categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas']
                },
                credits: {
                    enabled: false
                },
                series: [{
                    name: 'John',
                    data: [5, 3, 4, 7, 2]
                }, {
                    name: 'Jane',
                    data: [2, -2, -3, 2, 1]
                }, {
                    name: 'Joe',
                    data: [3, 4, 4, -2, 5]
                }]
            });
        });    
    </script>

</body></html>

I've already tried to play with this paths, but no matter:

<script type="text/javascript" src="http://code.highcharts.com/highcharts.js"></script>
<script type="text/javascript" src="http://code.highcharts.com/modules/exporting.js"></script>   

How to set a right path? For example, I use path like "highcharts/js/highcharts.js" and it's real exist in a project directory.

Upvotes: 0

Views: 2440

Answers (2)

Nagarajan A
Nagarajan A

Reputation: 89

I just copied your code and paste it in a html file. It's working very fine.

Here is the screenshot

enter image description here

Upvotes: 0

Iker V&#225;zquez
Iker V&#225;zquez

Reputation: 567

You missed the

</html> 

tag at the end.

However, your code on a fiddle works well.

Upvotes: 1

Related Questions