Defining Chart Properties, JavaScript Programming Example of Defining Chart Properties

Defining Chart Properties, JavaScript Programming Example of Defining Chart Properties

If you want to redefine the default properties of the chart, make use of the programming example below. Don't hesitate to use free coding samples by Webix to speed up the process of web development.

JS Code

webix.ui({
  id:"pivot",
  view:"pivot-chart",
  height:300,
  structure:{
    groupBy: "year",
    values:[
      {name:"balance", operation:"max", color: "#eed236"},
      {name:"oil", operation:"max", color: "#36abee"},
      {name:"gdp", operation:"max", color: "#476cee"}
    ],
    filters:[{name:"name", type:"select"}]
  },
  data:pivot_data,
  chartType: "line",
  chart: {
    scale: "logarithmic",
    barWidth: 25,
    legend: {
      layout: "x",
      align: "center",
      valign: "bottom"
    }
  }
});