在Highcharts Polar的地区点数

时间:2017-07-05 15:41:26

标签: highcharts

在极坐标图表中使用时,是否有办法使面积点圆整并使它们不那么尖锐?

我尝试了'areaspline',但是使用极坐标图表它并不完全正确,正如你在这里看到的那样:

http://jsfiddle.net/qwbu6r3t/2/

$(document).ready(function(){

      function getUserCoordinates() {
        if (navigator.geolocation) {
          navigator.geolocation.getCurrentPosition(setCoords);
        };
      };

      function setCoords(position) {
        lat = position.coords.latitude;
        lng = position.coords.longitude;
        updateUserLat(lat);
        updateUserLng(lng);
        document.getElementById("latitude").value = lat.toFixed(6);
        document.getElementById("longitude").value = lng.toFixed(6);
      };

      function updateUserLat(lat) {
        $.ajax({
          type: 'PATCH',
          url: '/users/:id',
          data: {'user[latitude]': lat}
        });
      };
      function updateUserLng(lng) {
        $.ajax({
          type: 'PATCH',
          url: '/users/:id',
          data: {'user[longitude]': lng}
        });
      };

      getUserCoordinates();

      function initMap(){
          initialize();
      };

});

修改

What I need

2 个答案:

答案 0 :(得分:0)

只需将区域更改为 areaspline 就可以按照我的意愿进行操作

答案 1 :(得分:0)

您可以使用相同的方法覆盖highcharts Highcharts.seriesTypes.areaSpline.prototype.getPointSpline,但使用更改的平滑参数。 (默认1.5)

...
var smoothing = 3, // 1 means control points midway between points, 2 means 1/3 from the point, 3 is 1/4 etc
...

实例: http://jsfiddle.net/q3h6xwog/

相关问题