Flexmonster - Define weekday type in JSON data

by Iryna Kulchytska

HTML

<script src="https://s3.amazonaws.com/flexmonster/2.2/flexmonster.js"></script>
<div id="pivot-content"></div>

JavaScript

flexmonster.embedPivotComponent("https://s3.amazonaws.com/flexmonster/2.2/", "pivot-content", "100%", "600", {
  licenseKey: "Z53G-1T1WC3-1V1M-0L12-2M0A-1233-1I0Y-2Y2Q-1903-322S-0T2C-1I",
  configuratorActive: false,
  rows: [
    {uniqueName: "Day of Week"}
  ],
  columns: [
    {uniqueName: "L4L", customSorting: ["Existing", "New", "Closed"]},
    {uniqueName: "[Measures]"}
  ],
  measures: [
    {uniqueName: "CS"}
  ],
  data: getData(),
  localSettingsUrl: "https://s3.amazonaws.com/flexmonster/2.2/loc-en-workdays-order.xml"
}, true);

function getData() {
  return [{
  	"L4L": { type: "string" },
    "Country": { type: "string" },
    "Store": { type: "string" },
    "Day of Week": { type: "weekday" },
    "CS": { type: "number" },
    "CS NET": { type: "number" }
  }, {
    "L4L": "Existing",
    "Country": "Germany",
    "Store": "store C",
    "Day of Week": "Wednesday",
    "CS": 1,
    "CS NET": 1
  }, {
    "L4L": "New",
    "Country": "Germany",
    "Store": "store A",
    "Day of Week": "Wednesday",
    "CS": 1,
    "CS NET": 1
  }, {
    "L4L": "Existing",
    "Country": "Germany",
    "Store": "store C",
    "Day of Week": "Monday",
    "CS": 1,
    "CS NET": 1
  }, {
    "L4L": "New",
    "Country": "Germany",
    "Store": "store A",
    "Day of Week": "Tuesday",
    "CS": 1,
    "CS NET": 1
  }, {
    "L4L": "Existing",
    "Country": "Germany",
    "Store": "store B",
    "Day of Week": "Thursday",
    "CS": 1,
    "CS NET": 1
  }, {
    "L4L": "Closed",
    "Country": "Germany",
    "Store": "store A",
    "Day of Week": "Sunday",
    "CS": 1,
    "CS NET": 1
  }, {
    "L4L": "Existing",
    "Country": "Germany",
    "Store": "store A",
    "Day of Week": "Saturday",
    "CS": 1,
    "CS NET": 1
  }, {
    "L4L": "New",
    "Country": "Germany",
    "Store": "store A",
    "Day of Week": "Wednesday",
    "CS": 1,
    "CS NET": 1
  }, {
    "L4L": "Existing",
    "Country": "Germany",
    "Store": "store A",
    "Day of Week": "Friday",
   ...