JavaScript
let pivot = new Flexmonster({
container: "#pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
width: "100%",
height: 350,
report: {
options: {
grid: {
title: "Date hierarchy",
},
},
dataSource: {
type: "api",
url: "https://olap.flexmonster.com:9500",
index: "data-types",
mapping: {
date_year: {
hierarchy: "Date",
caption: "Year",
},
date_month: {
hierarchy: "Date",
parent: "date_year",
caption: "Month",
},
date_day: {
hierarchy: "Date",
parent: "date_month",
caption: "Day",
},
},
},
slice: {
rows: [
{
uniqueName: "country",
},
],
columns: [
{
uniqueName: "Date",
levelName: "date_month",
},
{
uniqueName: "[Measures]",
},
],
measures: [
{
uniqueName: "price",
aggregation: "sum",
},
],
},
},
})
new Flexmonster({
container: "#pivot-container2",
componentFolder: "https://cdn.flexmonster.com/",
width: "100%",
height: 350,
report: {
options: {
grid: {
title: "Date folder",
},
},
dataSource: {
type: "api",
url: "https://olap.flexmonster.com:9500",
index: "data-types",
mapping: {
date_year: {
folder: "Date",
caption:"Year"
},
date_month: {
folder: "Date",
caption: "Month",
},
date_day: {
folder: "Date",
caption: "Day",
},
},
},
slice: {
rows: [
{
uniqueName: "country",
},
],
columns: [
{
uniqueName: "date_month",
}, {
uniqueName: "date_day",
},
{
uniqueName: "[Measures]",
},
],
...