color

defines items colors

string|function color;

Example

webix.ui({
    view:"chart",
    type:"bar",
    value:"#sales#",
    label:"#sales#",
    color:"#66ccff", // fixed color for all items
    data: dataset
});

Related samples

Details

If you want to take a color from your dataset, use the template:

color: "#color#"

color template function takes 4 parameters:

  • item {object} - item data object
  • index {number} - an item index
  • levelIndex {number} - 0 by default, for child items of multi-level pie can be 0,1,2,... depending on branch index
  • parentColor {string} - optional, null for all items except child items of multi-level pie
See also
Back to top
If you have not checked yet, be sure to visit site of our main product Webix js frameworks and page of javascript charting product.