<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->


<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <script src="lib/simpleRequire.js"></script>
        <script src="lib/config.js"></script>
        <script src="lib/jquery.min.js"></script>
        <script src="lib/facePrint.js"></script>
        <script src="lib/testHelper.js"></script>
        <!-- <script src="ut/lib/canteen.js"></script> -->
        <link rel="stylesheet" href="lib/reset.css" />
    </head>
    <body>
        <style>
        </style>



        <div id="main0"></div>









        <script>
        require(['echarts', 'map/js/china'], function (echarts) {
            var option;

            option = {
              "geo": {
                "map": "china",
                "roam": true
              },
              "visualMap": {
                "show": false,
                "min": 0,
                "max": 5,
                "inRange": {
                  "color": [
                    "blue",
                    "blue",
                    "green",
                    "yellow",
                    "red"
                  ]
                }
              },
              "series": [
                {
                  "type": "heatmap",
                  "coordinateSystem": "geo",
                  "geoIndex": 0,
                  "data": (function() {
                      var data = [];
                      while (data.length < 3500) {
                        data.push([
                            randomData(100, 120),
                            randomData(25, 40),
                            ~~(Math.random() * 1e3)
                        ]);
                      }
                      console.log(data)
                      return data;
                  })(),
                  "pointSize": 5,
                  "blurSize": 6
                }
              ]
            };

            function randomData(min, max) {
                return Math.random() * (max - min + 1) + min;
            }

            var chart = testHelper.create(echarts, 'main0', {
                title: [
                    'Heatmap in Geo coordinate system'
                ],
                height: 600,
                option: option
            });
        });
        </script>


    </body>
</html>

