Different bar widths on Chart

I would like to dynamically set the width of the bars based on the data in a stacked Bar chart. For example in the following snippet, my max value in the data is in the ratio100:400:100:300 .

https://snippet.webix.com/zjpezi4h

So I would like the bars to be in that ratio and also spread out over the total width of the chart. Is this possible to do with a stacked bar ?

I have a more elaborate sample for what I want at

https://snippet.webix.com/htpkevxy

All the bars are scaled to 100. But I would like the width of each of the bar to be proportional to the max value in the data. Is there any way to do this ?

Hello,
barWidth property can help you to set the width of bars. But it’s possible only if you set the value to a number. Like

webix.ui({
    view:"chart",
    type:"bar",
    ...
    
    barWidth:35   
});

I am not looking for a static barWidth. I need it to be proportional to some data value

Unfortunately, there is no solution. You can use only a fixed number

I have been able to find very complicated way to make that work by using multiple series but is not elegant. It would be good if barWidth could accept a function

@Nastja can you please look at this and comment whether there would be a problem with this approach ?

https://snippet.webix.com/umiej9gb

It works in almost all respects. The only issues are:

  1. I don’t know of a way to know the space used between bars so that i can spread the bars over all available space. In the example, Ii am using 200 a a hack.

  2. I would like to borderColor to be black but it somehow does not work. The borderColor property for bar charts does not always work. So this seems like a bug.

Hello,
Unfortunately, we don’t have such functionality to count the space between bars. I just can recommend you to look at other charts in Webix, and maybe you find another chart which will suit you by its functionality.
borderColor is supported by line charts, radar charts and scatter charts.