Custom CSS example

Custom CSS

by Flexmonster Pivot Table

HTML

<script src="https://cdn.flexmonster.com/flexmonster.js"></script>

<div id="pivot-container"></div>

CSS

@import url(https://cdn.flexmonster.com/assets/jsfiddle-styles.css);

/* GRID */

.fm-grid-view span,
.fm-grid-view div,
.fm-grid-view td {
  font-family: Verdana !important;
}

.fm-sheet-header {
  background-color: #8cf7be !important;
}

.fm-header,
.fm-row {
  background-color: #f5fdf3 !important;
}

#fm-pivot-view .fm-grid-layout .fm-filters .fm-header,
.fm-cols-filter div {
  background-color: #daf2e5 !important;
}

.fm-total {
  color: #263C53 !important;
  text-decoration: underline;
}

.fm-sheet-selection-canvas {
  background-color: rgba(72, 151, 241, 0.2) !important;
}

.fm-sheet-selection-canvas .fm-border {
  border: 1px solid #4897F1 !important;
}

JavaScript

let pivot = new Flexmonster({
  container: "#pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  toolbar: true,
  report: {
    dataSource: {
      filename: "data/data.csv"
    },
    slice: {
      columns: [{
        uniqueName: "Color"
      }],
      rows: [{
        uniqueName: "Country"
      }, {
        uniqueName: "[Measures]"
      }],
      measures: [{
        uniqueName: "Price",
        format: "currency"
      }, {
        uniqueName: "Discount",
        format: "currency"
      }],
    },
    formats: [{
      name: "currency",
      currencySymbol: "$",
      currencySymbolAlign: "left",
      thousandsSeparator: ",",
      decimalPlaces: 2
    }],
    options: {
      showGrandTotals: "off"
    }
  }
});