Kendo ui Bar Chart Width / max Bar Width

I have a Kendo ui chart diagram that is filled with a dynamic array.
Once it was filled with 12 items and once it was filled with only 1 item.
Now Bars automatically resizes when there is only one element in the array, Bar is super large.
I know that the configuration does not have the "max-width" or "width" property.

Is there a workaround for my problem? I.E. dynamic calculation of space / space or any other property? Or even using css or so?

Here is a simple fiddle

var dataset = [1,2,3,3,5,6,8];
var dataOnlyOne = [10]

//gap:0.2

// gap: function(){
    return width/12*...     // works not
}
+3
source share
1 answer

- , , , , - ...

, :

$(function() {
    var data = [1,2,3,3,5,6,8,2,3,3,5,6,8];
  //  var data = [10];
    var gap = 8/data.length
    $('#chart').kendoChart({
        seriesDefaults: {
            type: 'column',
            stack: true,
        },
        series: [
            {
                name: 'dataset',
                data: data,    // dataOnlyOne
                color: 'blue', 

                gap:gap
            }
        ]
    })
});
+2

All Articles