2015-05-10 25 views
0

我想知道如何Path2Path3之間因爲legend.label.padding適用於所有的人都卸下填充。聯想定製

enter image description here

legend: { 
    visible: true,    
    labels: { padding: 10} 
}, 
series: [{ 
    name: "Path1", 
    data: stats, 
    markers: { 
     visible: false, 
     color: 'red' 
    } 
}, { 
    name: "Path2", 
    data: stats2, 
    markers: { 
     visible: false 
},{ 
    name: "Path3", 
    data: stats2, 
    markers: { 
     visible: false, 
     color: 'blue' 
    } 
}], 

http://jsfiddle.net/3yhbyy2g/69/

+0

劍道聊天使用SVG及其包括圖例呈現。嘗試跟蹤與jQuery圖例位置是很難的,而動態圖表數據和圖例會更加困難。我建議你把你的傳奇劍道圖表之外.. –

+0

@Dion,我怎麼能這樣做呢?我會很高興,如果你能給我jsfiddle例子 – casillas

+0

標籤**'highcharts' **是無關緊要的。如果你不知道標籤不使用它。 –

回答

0

最簡單的方法是在JS手動選擇這個元素並設置自己的變換矩陣:

$('#chart > svg:nth-child(1) > g:nth-child(2) > g:nth-child(5) > g:nth-child(1) > g:nth-child(3)') 
    .attr('transform', 'matrix(1,0,0,1,439,100.5)'); 

但是,這也不是那麼好解決,因爲它不能抵抗劍道圖書館的變化

編輯: 你也可以嘗試使用legend.item.visual屬性在功能中有條件地設置圖例:http://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/chart#configuration-legend.item.visual

+0

以下http://stackoverflow.com/questions/30656016/legend-and-bar-chart-colors-do-not-match – hotspring

+0

suvroc任何想法,可以嘗試回答我的問題?我認爲你將能夠回答。鏈接:http://stackoverflow.com/questions/33889722/kendo-chart-legend-label-at-left-color-at-right – user2783091