Loading CSV, JavaScript Programming Example of Loading CSV

Loading CSV, JavaScript Programming Example of Loading CSV

Get the programming example for loading CSV files in Pivot Chart. You are welcome to use our free coding samples to build custom business web applications.

JS Code

webix.ui({
  rows:[
    { view: "label", label: "<b>USA  Selection Poll Data</b>"},
    {
      id:"pivot",
      view:"pivot-chart",
      height:350,
      structure: {
        groupBy: "data2",
        values: [{name:"data0", operation:"sum", color: "#36abee"}],
        filters:[{name:"data1", type:"select"},{name:"data3", type:"select"}]
      },
      fieldMap: {
        "data0": "Voter",
        "data1": "Party",
        "data2": "Precinct",
        "data3": "Age Group",
        "data4": "Last Voted",
        "data5": "Years Reg",
        "data6": "Ballot Status"
      },
      chart: {
        yAxis: {
          template: function(value){
            return parseInt(value,10)
          }
        },
        padding:{
          left: 60
        }
      },
      datatype: "csv",
      url: "//docs.webix.com/samples/61_pivot/common/example.csv"
    }
  ]
});