2013-03-15 3 views
0

이것이 그룹화와 관련이 있다고 생각합니다. 여기 차트 옵션 객체가 있습니다. 플롯 선과 계열은 비동기식으로 추가됩니다. 내 깃발 시리즈에는 text 매개 변수가 있습니다. 내가 무엇을 놓치고 있는지, 또는 이것이 정말로 dataGrouping의 유물입니까?Highcharts 주식 차트 플래그가 툴팁에 표시되지 않음


업데이트 :


chartOptions = { 
     chart: { 
      renderTo: 'chart', 
      backgroundColor:'rgba(255, 255, 255, 0.1)', 
      borderWidth: 0, 
      borderColor: "#FFFFFF", 
      defaultSeriesType: 'spline', 
      zoomType: 'x' 
     }, 
     colors: [ 
      '#666666', 
      '#AA4643', 
      '#4572A7' 
     ], 
     rangeSelector: { 
      buttonSpacing: 5, 
      buttonTheme: { 
       style: { 
        padding: "0 3px" 
       }, 
       width: null 
      }, 
      selected: 2, 
      buttons: [ 
       { 
        type: 'day', 
        count: 1, 
        text: 'Day' 
       }, 
       { 
        type: 'month', 
        count: 1, 
        text: 'Month' 
       }, 
       { 
        type: 'year', 
        count: 1, 
        text: 'Year' 
       }, 
       { 
        type: 'all', 
        text: 'All' 
       } 
      ] 
     }, 
     xAxis: { 
      type: 'datetime', 
      dateTimeLabelFormats: { 
       day: '%e %b \'%y', 
       month: '%b \'%y', 
       year: '%b \'%y' 
      }, 
      plotLines: [] 
     }, 
     yAxis: { 
      maxPadding: .05, 
      minPadding: .05, 
      title: { 
       text: 'Demand (kW)' 
      } 
     }, 
     navigator: { 
      enabled: true 
     }, 
     legend: { 
      enabled: true, 
      layout: 'horizontal', 
      align: 'center', 
      verticalAlign: 'top', 
      floating: true, 
      borderWidth: 0, 
      y: -5 
     }, 
     plotOptions: { 
      series: { 
       dataGrouping: { 
        approximation: "average", 
        groupPixelWidth: 30, 
        smoothed: true, 
        unit: [ 
         ['minute', [1]], 
         ['hour', [1]], 
         ['day',[1]], 
         ['week',[1]], 
         ['month',[1]], 
         ['year',null] 
        ] 
       }, 
       events: { 
        legendItemClick: function(event) { 
         return !(this.name == 'Baseline'); 
        } 
       }, 
       connectNulls: false, 
       marker: { 
        enabled: false, 
        states: { 
         hover: { 
          enabled: false 
         } 
        } 
       } 
      }, 
      flags: { 
       showInLegend: false, 
       style: { 
        borderColor: '#cc0000', 
        color: '#cc0000' 
       } 
      } 
     }, 
     series: [] 
    }; 

답변

0

실제로 이것은 dataGrouping.dateTimeLabelFormats가 정의되지 않아 발생합니다. 왜,하지만 분명히 기본값이 정의되지 않았으므로 API 참조에서 기본값을 붙여 넣었고 이제는 작동합니다.

0

귀하의 데이터가해야 내가 깃발 위에 마우스를 올려하면 "정의의 '주'속성을 읽을 수 없습니다 catch되지 않은 형식 오류를"내가지고있어 오늘을 발견 x로 오름차순으로 정렬.

+0

답장을 보내 주셔서 감사합니다. 내 데이터는 x 오름차순으로 정렬됩니다 (심지어 ksort를 추가 했음). 그러나 여전히 플래그에 대한 툴팁이 표시되지 않습니다. –

+0

데이터의 일부분을 붙여 넣을 수 있습니까? –

+0

내 데이터는 각각 8760 포인트의 여러 시리즈로 구성됩니다 (1 시간마다 1 년). 나는이 문제를 해결했다. 내 대답은 아래를 보라. 감사! –

관련 문제