0

I would like to know how to remove padding between Path2 and Path3 since legend.label.padding is applied to all of them.

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/

Raein Hashemi
  • 3,346
  • 4
  • 22
  • 33
casillas
  • 16,351
  • 19
  • 115
  • 215
  • Kendo chat is rendered using SVG and its including the legend. Try tracing legend position with jQuery is hard, and get harder with dynamic chart data and legend.. I suggest you put your legend outside the kendo chart.. – Dion Dirza May 11 '15 at 04:52
  • @Dion, How could I do that? I would be glad if you could give me jsfiddle example – casillas May 11 '15 at 04:55
  • The tag **`highcharts`** is irrelevant. If you don't know the tag don't use it. – Raein Hashemi May 11 '15 at 06:06
  • creating additional legend take extra code to do, you have to set legend visible in chart as false and create a group list of your series data using listview, so you can modify its appearance easier.. – Dion Dirza May 11 '15 at 06:12
  • Hello Dion, could you please elaborate how to achieve? – casillas May 18 '15 at 14:07

1 Answers1

0

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

suvroc
  • 3,058
  • 1
  • 15
  • 29
  • Any idea for the following http://stackoverflow.com/questions/30656016/legend-and-bar-chart-colors-do-not-match – casillas Jun 05 '15 at 03:31
  • suvroc, can you try answer to my question? I think you will be able to answer. link: http://stackoverflow.com/questions/33889722/kendo-chart-legend-label-at-left-color-at-right – user5260143 Nov 25 '15 at 09:33