Appending to data labels

Easily insert custom strings into the data label object using `"overlays"`.

  • Use the array "overlays" to pass a list of objects for each corresponding data label. Each data label can have multiple overlays applied to it.

  • Overlays can require a 'value' (string), 'color' and where in relation to the data label the overlay needs to be positioned ('position').

Reference:

Download: input.zip | output.pptx


{
  "presentation": {
    "template": "template.pptx",
    "slides": [
      {
        "slide_index": 0,
        "shapes": [
          {
            "name": "Chart 1",
            "title": "Automating shape types",
            "categoryTitle": "Month",
            "valueTitle": "Times used",
            "data": [
              ["Intense Demand", "Dip-in Demand", "Low-no Demand"],
              [
                "Read a printed newspaper",
                "Visited a newspaper website",
                "Read a printed magazine",
                "Read a digital magazine",
                "None of the above"
              ],
              [25.87, 38.58, 49.69],
              [49.05, 40.58, 38.45],
              [100, 75.23, 34.98],
              [6.54, 5.64, 4.96],
              [78.32, 95.75, 97]
            ],
            "overlays": [
              [
                {
                  "value": "\u2191",
                  "color": "255,0,0",
                  "position": "left"
                },
                {
                  "value": "\u2194",
                  "color": "255,0,0",
                  "position": "above"
                },
                {
                  "value": "\u2191",
                  "color": "255,0,0",
                  "position": "above"
                }
              ],
              [
                {
                  "value": "\u2193",
                  "color": "255,0,0",
                  "position": "below"
                }
              ],
              [
                {
                  "value": "\u2193",
                  "color": "255,0,0",
                  "position": "left"
                },
                {
                  "value": "\u2193",
                  "color": "255,0,0",
                  "position": "above"
                }
              ],
              [
                {
                  "value": " \u2191",
                  "color": "255,0,0",
                  "position": "right"
                }
              ],
              [{}],
              [{}],
              [
                {
                  "value": "\u2191",
                  "color": "255,0,0",
                  "position": "right"
                }
              ],
              [
                {
                  "value": "\u2191",
                  "color": "255,0,0",
                  "position": "right"
                }
              ],
              [{}],
              [{}],
              [{}],
              [{}],
              [
                {
                  "value": "\u2194",
                  "color": "255,0,0",
                  "position": "below"
                }
              ],
              [{}],
              [{}]
            ]
          }
        ]
      }
    ]
  }
}

Last updated

Was this helpful?