CSV data source

Data source

by Janez231

HTML

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

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

JavaScript

let pivot = new Flexmonster({
  container: "pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  toolbar: true,
  report: {
    "dataSource": {
        "type": "json",
        "data": [
            {
                "ProductType": {
                    "caption": "ProductType",
                    "type": "string"
                },
                "Product": {
                    "caption": "Product",
                    "type": "string"
                },
                "Price": {
                    "caption": "Price",
                    "type": "number"
                }
            },
            [
                "pt1",
                "p1",
                20
            ],
            [
                "pt2",
                "p2",
                56
            ],
            [
                "pt3",
                "p3",
                45
            ],
            [
                "pt2",
                "p4",
                32
            ],
            [
                "pt3",
                "p5",
                12
            ],
            [
                "pt1",
                "p6",
                -32
            ],
            [
                "pt2",
                "p7",
                32
            ]
        ]
    },
    "slice": {
        "rows": [
            {
                "uniqueName": "ProductType"
            },
            {
                "uniqueName": "Product"
            }
        ],
        "columns": [
            {
                "uniqueName": "[Measures]"
            }
        ],
        "measures": [
            {
                "uniqueName": "Price",
                "aggregation": "sum"
            },
            {
                "uniqueName": "% of Grand Total Price",
                "formula": "percent(\"Price\")",
                "caption": "% of Grand Total Price",
                "format": "-1by13h3l37ja00"
            },
            {
                "uniqueName": "% of Parent Row...