2016-10-07 46 views
0

我正在尋找使用倒列列表圖表從高圖形開發甘特圖,並需要能夠對給定數據點可視化里程碑(highcharts符號?)。我到目前爲止:http://jsfiddle.net/gys2jxhw/。這可能嗎?Highcharts:向倒序列圖表系列添加符號

$(函數(){

$('#container').highcharts({ 

    chart: { 
     type: 'columnrange', 
     inverted: true 
    }, 

    title: { 
     text: 'Project Deliverables' 
    }, 

    xAxis: { 
     categories: ['Task X'] 
    }, 

    yAxis: { 
     title: { 
      text: 'Timeline' 
     },    
     type: 'datetime' 
    }, 

    tooltip: { 
     xDateFormat: '%Y-%m-%d' 
    }, 

    plotOptions: { 
     columnrange: { 
      dataLabels: { 
       enabled: false, 
       formatter: function() { 
        return this.y; 
       } 
      } 
     } 
    }, 

    legend: { 
     enabled: false 
    }, 

    series: [{ 
     name: 'Timeline', 
     data: [{ 
      low:Date.UTC(2013,5,2), 
      high: [Date.UTC(2013,5,12)] 
     }] 
    }] 
}); 

});

+0

你想要像這樣的「里程碑」嗎? http://imgur.com/a/BoHnf – nilsole

+0

您可以使用'scatter'系列在任何地方繪製符號,並且可以使用'plotLines'和/或'plotBands'來標記公共線或區域。 – jlbriggs

+0

我在想更像這樣:http://imgur.com/a/ZICmk。但我很靈活。 – user1644708

回答

0

您可以使用散點圖系列在任意位置放置點。

所以,隨着您的系列設置:

series: [{ 
    name: 'Timeline', 
    data: [{ 
    low: Date.UTC(2013, 5, 2), 
    high: [Date.UTC(2013, 5, 12)] 
    }] 
}] 

添加第二個系列是類型:散射,並放置點,無論你需要它:

series: [{ 
    name: 'Timeline', 
    data: [{ 
    low: Date.UTC(2013, 5, 2), 
    high: [Date.UTC(2013, 5, 12)] 
    }] 
}, { 
    name: 'Marker', 
    type: 'scatter', 
    data: [ 
    [0, Date.UTC(2013, 5, 12, 12, 0, 0)] 
    ] 
}] 

更新小提琴:

然後,您可以通過使用工具提示和/或數據標籤來進一步增強該值,以傳達其他信息。