2015-05-10 22 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