问题
I would like to know how to remove padding between Path2
and Path3
since legend.label.padding
is applied to all of them.
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/
回答1:
The easiest way is to manually select this element in js and set your own transformation matrix:
$('#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)');
But this is not so good solution, because it is not resistant to changes in Kendo library
EDIT: You can also try to use legend.item.visual property to setup legend conditionally in function: http://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/chart#configuration-legend.item.visual
来源:https://stackoverflow.com/questions/30156110/legend-customization