2016-11-23 84 views
0

我有一個顯示日期的Highcharts圖表,但工具提示標題顯示的日期爲(例如)1477958400000,當我希望它說「星期二,2016年11月1日」時。如何更改工具提示標題上的日期格式?在Highcharts中設置工具提示的格式日期值

UPDATE:這是我Highcharts代碼:

Highcharts.chart('div-container', { 
    chart: { 
     type: 'area' 
    }, 
    title: { 
     text: 'Balances' 
    }, 

    tooltip: { 
     shared: true, 
     useHTML: true, 
     pointFormat: '<span style="font-weight: bold;color:{series.color}">{series.name}</span>: <b>{point.y}</b><br/>', 

     valueDecimals: 4 
    }, 

    plotOptions: { 
     area: { 
      stacking: 'normal', 

      lineColor: '#666666', 
      lineWidth: 1, 

      marker: { 
       lineWidth: 1, 
       lineColor: '#666666' 
      } 
     } 
    }, 

    series: contribution_type_balances_series 
}); 

...這裏是我的數據:

Date,Series1,Series2,Series3 
2016-11-01,51133.8941,5709.6097,22837.8403 
2016-11-02,50507.2502,5639.6387,22557.9634 
2016-11-03,50967.3341,5644.3896,22576.977 
2016-11-04,51310.3385,5663.6562,22654.0417 
2016-11-05,51310.3385,5663.6562,22654.0417 
2016-11-06,51310.3385,5663.6562,22654.0417 
2016-11-07,52434.202,5787.7087,23150.239 
2016-11-08,52607.4831,5806.8356,23226.7444 
2016-11-09,53741.9039,5932.0534,23727.6028 
2016-11-10,54068.759,5968.1318,23871.9127 
2016-11-11,54068.759,5968.1318,23871.9127 
2016-11-12,54068.759,5968.1318,23871.9127 
2016-11-13,54068.759,5968.1318,23871.9127 
2016-11-14,55476.6901,6123.5396,24493.53 
2016-11-15,55483.3455,6124.2742,24496.4684 
2016-11-16,55552.7511,6131.9353,24527.1117 
2016-11-17,56104.0877,6147.0583,24587.6056 
2016-11-18,56088.9295,6126.8777,24506.8854 
+0

添加您的代碼在這裏,可能原因是你缺少類型:dateTime –

回答

0
$(function() { 
    Highcharts.chart('container', { 
    chart: { 
     type: 'area' 
    }, 
    title: { 
     text: 'Balances' 
    }, 


    data: { 
     csv: document.getElementById('csv').innerHTML 
    }, 

    plotOptions: { 
     area: { 
     stacking: 'normal', 

     lineColor: '#666666', 
     lineWidth: 1, 

     marker: { 
      lineWidth: 1, 
      lineColor: '#666666' 
     } 
     } 
    }, 
    series: [{ 
     lineWidth: 1 
    }] 
    }); 
}); 

DEMO