我使用highcharts創建了一個基本boxplot,它顯示了當我將鼠標懸停時最大值,最小四分位數,中位數,最小四分位數和最小值在箱子陰謀。我想以某種方式在劇情本身旁邊的每一行顯示這些值。Highcharts:在箱形圖中顯示標籤(最小,最大,中位數等)
我檢查了api,發現「dataLabel」會有所幫助,但這並不支持boxplot。有人能告訴我如何實現這一目標嗎?
謝謝。
我使用highcharts創建了一個基本boxplot,它顯示了當我將鼠標懸停時最大值,最小四分位數,中位數,最小四分位數和最小值在箱子陰謀。我想以某種方式在劇情本身旁邊的每一行顯示這些值。Highcharts:在箱形圖中顯示標籤(最小,最大,中位數等)
我檢查了api,發現「dataLabel」會有所幫助,但這並不支持boxplot。有人能告訴我如何實現這一目標嗎?
謝謝。
不幸的是,這個選項不被支持,只有你可以做的是使用渲染器來添加圖表內的自定義文本,但我知道它可能不是很舒服的解決方案。 http://api.highcharts.com/highcharts#Renderer.text()
Obviosuly您可以在我們的用戶語音系統http://highcharts.uservoice.com/
添加另一個數據系列,這是一種「分散」的數據和標籤適用於本系列使用標記傳請求你的建議。訣竅是使用與背景顏色和0行寬相同的填充顏色,因此標記將不可見,只會顯示標籤。
{
name: 'Outlier',
color: 'white',
type: 'scatter',
data: [ // x, y positions where 0 is the first category
{
name: 'This is my label for the box',
x:0, //box index. first one is 0.
y:975 //it will be bigger than the maximum value of of the box
}
],
dataLabels : {
align: 'left',
enabled : true,
formatter : function() {
return this.point.name;
},
y: 10,
},
marker: {
fillColor: 'white',
lineWidth: 0,
lineColor: 'white'
}
}
不可能開箱即用,但正如Steve Gu所提到的那樣,可以通過scatter實現。您甚至可以忽略格式化程序並全部禁用標記:
{
series: [
{
type: 'scatter',
tooltip: {
enabled: false
},
dataLabels: {
format: '{key}',
enabled: true,
y: 0,
},
data: [{ x: 0, y: 975, name: '975'}],
marker: {
enabled: false,
}
}
]
}
只是禁用標記並將格式設置爲鍵。