Mapping Field Names, JavaScript Programming Example of Mapping Field Names

Mapping Field Names, JavaScript Programming Example of Mapping Field Names

Check out the programming example below for renaming fields in Pivot Chart. Feel free to use coding samples by Webix to speed up the process of web development.

JS Code

webix.ui({
  id:"pivot",
  view:"pivot-chart",
  height:350,
  structure:{
    groupBy: "year",
    values: [{name:"balance", operation:"max"},{name:"oil", operation:"max"}],
    filters:[{name:"name", type:"select"}]
  },
  data:pivot_data,

  // change titles
  fieldMap:{
    gdp: "GDP",
    balance: "Balance of Payments",
    oil: "Oil",
    form: "Form of Government",
    name: "Country",
    year: "Year",
    continent: "Continent",
    id: "Id"
  },
  filterLabelWidth: 140,
  chart: {
    legend:{
      width: 200
    }
  }
});