Customize Options

{
  leavePageWarning: 1,    // When user leave page, whether show a warning or not

  locale: 'en',           // Current language locale
                          // it should be set to one of values in below availableLocals

  availableLocales: ['en','zh','de','tr','es','pt','it'],
                          // Selectable language locales for users to switch languages
                          // possible locales like: 'en','zh','tr', 'es','pt',‘fr','de','ar',
                          // 'ru','it', 'nl','el','he','hi','hu','sv','ko','ja'

  localeFilePath: './lang/',     // locale file path

  server: {
    aboutUrl: 'http://webpivottable.com',
    helpUrl: 'http://backup.webpivottable.com',
    fileProxyEnabled: 1,          // enable/disable file Proxy 1/0
    fileProxy: 'http://demo.webpivottable.com/wpt/fileProxy',  // Server proxy for cross domain file acess
    fileTimeout: 30000,
    xmlaProxyEnabled: 1,        // enable/disable Xmla Proxy 1/0
    xmlaProxy: 'http://demo.webpivottable.com/wpt/xmlaProxy', // Server proxy for cross domain xmla access
    xmlaTimeout: 30000,
    basicAuthEnabled : 0,       // enable/disable Basic Authentication
    username : 'username',      // Basic Authentication username
    password : 'password',      // Basic Authentication password
    rolesEnabled : 0,           // enable/disable roles control
    roles : 'test',             // comma separate roles list
  },

  limit: {
    sourceDataMaxRows: 100000,         // maximum supported rows of source data
    sourceDataMaxColumns: 1000,        // maximum supported rows of source data
    sourceDataMaxDataCells: 10000000,  // maximum supported rows of source data
    sheetLayoutMaxRows: 1000,          // sheet layout maximum rows
    sheetLayoutMaxColumns: 1000,       // pivot layout maximum columns
    sheetLayoutMaxDataCells: 10000,    // sheet layout maximum data cells
    olapDrillThroughMaxRows: 1000,     // Max return rows for each Olap drill through call
  },

  smallScreenBreakpoint: 768,    // with < 768     Small Screen device (phone)
  mediumScreenBreakpoint: 1080,  // 768 <= width <= 1080  (tablet)
  navigationPanelWidth: 300,

  decimalPoint: '.',        // decimal point charactor: '.', ','
  thousandsSep: ',',        // thousands separator: ',' '.', ' '
  defaultToDistinctCount: 0, // Default statistic function of String field to distinct count
  drillThroughBySingleClick: 0,  // dblclick/click to drill through pivot grid or pivot charts
  deferLayoutExcludeFilter: 0,   // exclude field sort/filter from defer layout update
  defaultValueFormat: {
    category: WptConstants.VALUE_FORMAT_CATEGORY_NUMBER,
    negative: WptConstants.VALUE_NEGATIVE_RED_MINUS
  },  // Default format for negative number

  uiFlags: {              // A set of flags to control User Interface

    header: 1,            // show/hide header

    source: 1,            // show/hide Source View
    sheet: 1,             // show/hide Sheet View
    report: 1,            // show/hide Report View

    newWpt: 1,            // show/hide header "Create New WPT" button/menu
    openWpt: 1,           // show/hide header "Open WPT" button/menu
    saveWpt: 1,           // show/hide header "Save WPT" button/menu

    message: 1,           // show/hide header message section
    fullScreen: 1,        // enable/disable "Full Screen" mode
    localeSwitch: 1,      // show/hide header locale switch

    menuBar: 1,           // show/hide header menu bar
                          // Hide only works on Component edition
    setting: 1,           // show/hide header Setting button/menu
    help: 1,              // show/hide header Help button/menu
                          // Hide only works on Component edition
    about: 1,             // show/hide header About button/menu
                          // Hide only works on Component edition

    memoryMode: 1,        // show/hide Load data view "Memory" Tab
    olapMode: 1,          // show/hide Load data view "OLAP" Tab

    loadFromCsv: 1,       // enable/disable Load data from csv file
    loadFromExcel: 1,     // enable/disable Load data from excel file
    loadFromGss: 1,       // enable/disable Load data from "Google Spreadsheet"
    loadFromWs: 1,        // enable/disable Load data or wpt from "Web Service"

    saveToLocal: 1,       // show/hide Save WPT dialog "Save to local" Tab
    saveToServer: 1,      // show/hide Save WPT dialog "Save to Server" Tab

    sourceEditable: 1,    // add/rename/remove/change source or not
    sheetEditable: 1,     // add/rename/remove/change sheet or not
    reportEditable: 1,    // add/rename/remove/change report or not

    sourceRefine: 1,        // show/hide source refine data
    sourceExportToCsv: 1,   // show/hide source "Export to csv"
    sourceExportToExcel: 1, // show/hide source "Export to Excel"
    sourceFullScreen: 1,    // show/hide source "Full Screen"

    sheetExpandCollapse: 1,  // show/hide sheet expand/collapse all
    sheetGridChartLayout: 1, // show/hide sheet grid/chart layout
    sheetPivotOnBar: 1,      // show/hide sheet piovt on bar

    gridOptionsBar: 1,    // show/hide grid options bar
    gridChangeSize: 1,    // show/hide grid change size
    gridChangeForm: 1,    // show/hide grid change form
    gridExportToExcel: 1, // show/hide grid "Export to Excel"
    gridExportToHtml: 1,  // show/hide grid "Export to HTML"
    gridExportToPdf: 1,   // show/hide grid "Export to PDF"
    gridFullScreen: 1,    // show/hide grid "Full Screen"

    chartOptionsBar: 1,   // show/hide chart options bar
    chartChangeSize: 1,   // show/hide chart change size
    chartChangeType: 1,   // show/hide chart change type
    chartChangeLabels: 1, // show/hide chart change labels
    chartExportToHtml: 1, // show/hide chart "Export to HTML"
    chartExportToPdf: 1,  // show/hide chart "Export to PDF"
    chartFullScreen: 1,   // show/hide chart  "Full Screen"

    reportExportToHtml: 1, // show/hide report "Export to HTML"
    reportExportToPdf: 1,  // show/hide report "Export to PDF"
    reportFullScreen: 1,   // show/hide report "Full Screen"

    refineFullScreen: 1,   // show/hide refine "Full Screen"

    calculatedField: 1   // show/hide calculated field function
  },

  styles: {
    fontSize: '14px',
    windowHeaderColor: 'lightblue',
    toolBarColor: 'aliceblue',                   // toolbar background color
    highLightColor: 'rgb(250, 224, 177)',   // highlight background color
    messageColor: 'orangered'
  },

  fileLinks:[
    {
      type: WptConstants.FORMAT_WPT,
      url: "http://demo.webpivottable.com/samples/file9.wpt",
      label: "Test file 9 (olap mode)"
    },{
      type: WptConstants.FORMAT_WPT,
      url: "http://demo.webpivottable.com/samples/file8.wpt",
      label: "Test file 8 (memory mode)"
    },{
      type: WptConstants.FORMAT_CSV,
      url: "http://demo.webpivottable.com/json/example.csv",
      label: "USA Selection Poll Data (Total 4,000 records)"
    },{
      type: WptConstants.FORMAT_CSV,
      url: "http://demo.webpivottable.com/json/sales.csv",
      label: "Sales Sample Data (Total 2,823 records)"
    },{
      type: WptConstants.FORMAT_CSV,
      url: "http://demo.webpivottable.com/json/FL_insurance.csv",
      label: "Florida Insurance Data (Total 36,634 records)"
    },{
      type: WptConstants.FORMAT_EXCEL,
      url: "http://demo.webpivottable.com/json/example.xls",
      label: "USA Selection Poll Data (Total 4,000 records)"
    },{
      type: WptConstants.FORMAT_EXCEL,
      url: "http://demo.webpivottable.com/json/sales.xls",
      label: "Sales Sample Data (Total 2,823 records)"
    },{
      type: WptConstants.FORMAT_EXCEL,
      url: "http://demo.webpivottable.com/json/FL_insurance.xls",
      label: "Florida Insurance Data (Total 36,634 records)"
    },{
      type: WptConstants.FORMAT_EXCEL,
      url: "http://demo.webpivottable.com/json/example.xlsx",
      label: "USA Selection Poll Data (Total 4,000 records)"
    },{
      type: WptConstants.FORMAT_EXCEL,
      url: "http://demo.webpivottable.com/json/sales.xlsx",
      label: "Sales Sample Data (Total 2,823 records)"
    },{
      type: WptConstants.FORMAT_EXCEL,
      url: "http://demo.webpivottable.com/json/FL_insurance.xlsx",
      label: "Florida Insurance Data (Total 36,634 records)"
    },{
      type: WptConstants.FORMAT_WSWPT,
      url: "http://demo.webpivottable.com/json/sample91.wpt",
      label: "Predefined small CSV WebPivotTable file"
    },{
      type: WptConstants.FORMAT_WSDATA,
      url: "http://demo.webpivottable.com/wpt/wsSample",
      label: "Simple Sample Web Service"
    },{
      type: WptConstants.FORMAT_GSS,
      url: "https://docs.google.com/spreadsheet/pub?key=0Alkl5EEsxBwBdDFLV2Q4a1NWMmw1TXZBRlFMZ1Rxd0E&output=html",
      label: "USA Selection Poll Data (Total 4,000 records)"
    },{
      type: WptConstants.FORMAT_GSS,
      url: "https://docs.google.com/spreadsheet/pub?key=0Alkl5EEsxBwBdHJMOTh4Sm1BSFlDYXRwVW5lc0xuMVE&output=html",
      label: "Sales Sample Data (Total 2,823 records)"
    },{
      type: WptConstants.FORMAT_OLAP,
      url: "http://olap.flexmonster.com/olap/msmdpump.dll",
      label: "Sample Microsoft Analysis Service"
    },{
      type: WptConstants.FORMAT_OLAP,
      url: "http://sampledata.infragistics.com/data/msmdpump.dll",
      label: "Sample Microsoft Analysis Service 1"
    },{
      type: WptConstants.FORMAT_OLAP,
      url: "http://demo.webpivottable.com:8080/mondrian/xmla",
      label: "Sample Mondrian OLAP Server"
    },{
      type: WptConstants.FORMAT_OLAP,
      url: "http://demo.webpivottable.com:8282/icCube/xmla",
      label: "Sample icCube OLAP Server"
    }
  ],

  customizeNew: {           // If enabled, click "Create New Wpt" button will not open dialog.
    // Integration developers can hook their own handler in callback
    enabled: false,       // enable/disable this hook
    callback: function(webPivotTable){} // customize handler when click "Create New Wpt" button
  },

  customizeOpen: {          // If enabled, click "Open Wpt" button will not open dialog.
    // Integration developers can hook their own handler in callback
    enabled: false,       // enable to call user customize save wpt UI
    callback: function(webPivotTable){} // customize handler when click "Open Wpt" button
  },

  customizeSave: {          // If enabled, click "Save Wpt" button will not open dialog.
    // Integration developers can hook their own handler in callback
    enabled: false,       // enable to call user customize save wpt UI
    ignoreData: false,    // whether the passed wptString include data or not
    callback: function(webPivotTable, wptString){} // customize handler when click "Save Wpt" button
  },

  customizeDrillThrough: {  // If enabled, click cell in grid or chart will not open dialog.
    // Integration developers can hook their own handler in callback
    enabled: false,       // enable to call user customize save wpt UI
    callback: function(webPivotTable, sheet, rowItem, colItem, event){}
    // customize handler when click a cell to drill through
  },

  customizeButtons: [       // Add Customize buttons on top bar
    // {
    //    label: "Customize",
    //    title: "Customize button",
    //    click: function (evt){
    //        alert("haha, customize button was clicked!");
    //    }
    // },
    // {
    //     type: "select",
    //     value: "value2",
    //     style: "width:200px;",
    //     options: [{
    //       label: "label1", value: "value1"
    //     }, {
    //       label: "label2", value: "value2"
    //     }, {
    //       label: "label3", value: "value3"
    //     }],
    //     change: function (value){
    //        console.log("onchange triggered", value);
    //     }
    // }
  ],

  filestack: {
    enabled: true,        // enable to use filestack to load data
    key: "A4bieoUsyR4yBrNPkFIvrz"  //demo.webpivottable.com
    // key: ''                // filestack application key
  },

  webServiceTimeout: 10000,  // Web Service call timeout setting

  exporting: {
    pdf: {
      paperMarginTop: '1cm',
      paperMarginLeft: '1cm',
      paperMarginBottom: '1cm',
      paperMarginRight: '1cm',
      paperFormat: 'A4', //'A3', 'A4', 'A5', 'Legal', 'Letter', 'Tabloid'. 'Custom'
      paperOrientation: 'portrait',  //'portrait', 'landscape'
      paperWidth: '600px',
      paperHeight: '600px',
      headerHeight: '1cm',
      header: '',
      footerHeight: '1cm',
      footer: '',
      zoomFactor: 1
    }
  },

  source: {                  // Default options for each new source
    navigationPanel: {          // Navigation Panel
      show: 1,                  // show/hide: 1/0
      position:'right',         // position: 'left', 'top', 'right', 'bottom'
      stacked: 0,               // stack fields area or not: 1/0
      width: 300,               // width, only for left and right
      height: 200               // height, only for top and bottom
    },
    fieldsListFilter: "",
    fieldsListSort: 0,          // -1 descend, 1- ascend, 0-no sort
    grid: {
      cellWidth: 120,
      cellHeight: 21
    }
  },

  report: {                  // Default options for each new report
    navigationPanel: {          // Navigation Panel
      show: 1,                  // show/hide: 1/0
      position:'right',         // position: 'left', 'top', 'right', 'bottom'
      stacked: 0,               // stack fields area or not: 1/0
      width: 300,               // width, only for left and right
      height: 200               // height, only for top and bottom
    },
    width: 1000,
    header: {
      width: {
        value: 100,
        measure: "%"   // %, px,
      },
      height: {
        auto: true,
        value: 100,
        measure: "px"
      },
      padding: {
        top: 10,
        right: 10,
        bottom: 10,
        left: 10
      },
      title: {
        enabled: true,
        align: 'center',          // left, center, right
        margin: {
          top: 10,
          right: 10,
          bottom: 10,
          left: 10
        },
        fontSize: 28,
        fontWeight: "bold"
      }

    },

    component: {
      width: {
        value: 50,
        measure: "%"   // %, px,
      },
      height: {
        auto: true,
        value: 300,
        measure: "px"
      },
      title: {
        enabled: true,
        align: 'center',            // left, center, right
        margin: {
          top: 10,
          right: 10,
          bottom: 10,
          left: 10
        },
        fontSize: 24,
        fontWeight: "bold"
      },
      content:{
        align: 'center',            // left, center, right
        margin: {
          top: 10,
          right: 10,
          bottom: 10,
          left: 10
        }
      }
    }
  },

  sheet:{                    // Default options for each new sheet

    sheet: {
      chartFirst: 0,          // show chart at top/left? 0/1
      pivotLayout: WptConstants.PIVOT_LAYOUT_TILE_VERTICAL,
                              // Pivot Grid and chart layout
                              // 0 -- tile horizontal, 1 -- tile vertical,
                              // 2 -- grid only,  3 -- chart only
      expandRows: 1,          // Expand/collapse All rows
      expandCols: 1,          // Expand/Collapse All columns
      showRowTotals: 1,
      showColTotals: 1,
      showRowSubtotals: 1,
      showColSubtotals: 1,

      navigationPanel: {          // Navigation Panel
        show: 1,                  // show/hide: 1/0
        position:'right',         // position: 'left', 'top', 'right', 'bottom'
        stacked: 0,               // stack fields area or not: 1/0
        width: 300,               // width, only for left and right
        height: 200               // height, only for top and bottom
      },
      deferLayoutUpdate: false,
      fieldsListFilter: "",
      fieldsListSort: 0,          // -1 descend, 1- ascend, 0-no sort
    },

    grid: {
      showSigns: 1,
      showEmptyAsZero: 0,
      compactForm: 1,
      rowHeaderWidth: 200,
      cellWidth: 100,
      cellHeight: 20,
      theme: 'wpt-default',
      noFixedColumns: 0,
      cellStyle: {
        columnHeader: {
          textAlign: 'center',
          backgroundColor: '#bfd6eb',
          fontWeight: 'bold',
        },
        compoundColumn: {
          verticalAlign: "top",
          textAlign: 'left',
          backgroundColor: '#bfd6eb',
          fontWeight: 'bold',
        },
        rowHeader: {
          textAlign: 'left',
          backgroundColor: '#bfd6eb',
          fontWeight: 'bold',
        },
        compoundRow: {
          verticalAlign: "top",
          textAlign: 'left',
          backgroundColor: '#bfd6eb',
          fontWeight: 'bold',
        },
        totalCell: {
          textAlign: 'right',
          backgroundColor: '#72d2df',
        },
        subtotalCell: {
          textAlign: 'right',
          backgroundColor: '#d2e9e9',
        },
        dataCell: {
          textAlign: 'right',
          backgroundColor: '#eee',
        },
        noDataCell: {
          backgroundColor: "#ddd",
        }
      },
    },

    chart: {
      width: 500,
      height: 300,
      combined: true,

      high:{
        theme: 'default', //default, grid, gray, skies, drak-blue, drak-green
        chart:{
          type:'column',  //column, bar, line, spline, area, areaspline, pie
          options3d: {
            enabled: false,
            alpha: 15,
            beta: 15,
            depth: 50,
            viewDistance: 25
          }
        },
        credits: {
          enabled:false
        },
        exporting: {
          enabled:false
        },
        navigation:{
          buttonOptions:{
            align: 'right',   // left, center, right
            verticalAlign: 'top' // top, middle, bottom
          }
        },
        legend: {
          enabled: true,
          floating: false,
          layout: 'vertical',  //horizontal, vertical
          align: 'right',      // left, center, right
          verticalAlign: 'middle', // top, middle, bottom
          reversed: false
        },
        tooltip:{
          enabled: true,
          shadow: true
        },
        plotOptions: {
          series:{
            stacking: null, //null, 'normal', 'percent'
            dataLabels: {
              enabled: false,
              align:'center',  // left, center, right
              rotation:0    // 0 -- 360
            }
          }
        },
        xAxis: {
          labels:{
            enabled: true,
            align:'left',  // left, center, right
            rotation:45    // 0 -- 360
          }
        }
      }
    }
  }
}