Incorrect bar sparkline in grid cell

I am trying to show (negative and positive) horizontal bar inside cells. Bar heights shown are wrong, that is, does not obey dataset:


webix.ready(function(){
  webix.ui({
    view:"datatable",
    columns:[
      { id:"id", header:" ", width:50 },
      { id:"name", header:"Name"},
      // sparklines
      {
        id:"balance", header:"Balance per Month",
        template:webix.Sparklines.getTemplate({
    type:"bar", origin:0.0,
    horizontal: true})},],        
    autoheight:true,
    scrollX: false,
    data: [
      {id:1, name:"Austria", balance:[{value: -10, month: "January"}] },
      {id:2, name:"France", balance:[{value: 10, month: "January"}] },
      {id:3, name:"Germany", balance:[{value: 18, month: "January"}] },
      {id:4, name:"UK", balance:[{value: 12, month: "January"}] }
    ]
  });
});

Hello @JohnDino ,

Each sparkline is created separately for its own cell, so the values ​​are automatically scaled independently of one another.
There is a scale property for the bar chart type that provides a maximum value, related to which all other values will be scaled: Code Snippet .

However, as you could see it does not work for the negative values in a horizontal chart. We will consider updating the logic, thank you!

For now, you could
a.) customize the sparkline bar chart methods that draw the template. e.g. like so: Code Snippet . Here we mostly repeat the original logic but add new scale and origin calculation lines. Please, note that methods that start with _ in Webix are considered to be privite methods so they will be obfuscated in the min.js (minified) version of the library. So, while we can easily rewrite the getPoints(), _getOrigin() will get a new name with the each new library build.
b.) you could define your own SVG template for the sparkline cells where you be able to fully control the logic of rendering your values, e.g. the basic example: Code Snippet .