Datapoints

  1. Select the shape by name you want to modify. See here to find shape names.

  2. Define the chart’s data under data.

  3. Use settings.isChartLabelValueVisible to globally enable or disable all value labels.

  4. Use datapoints to override that setting for specific data points.

  5. Each datapoint uses:

    1. categoryIndex: the position of the data point on the X-axis (starting from 0).

    2. seriesIndex: the index of the data series in your dataset (starting from 0).

    3. isLabelValueVisible: whether the label for that specific point should be visible.

Reference: chart

Download: input.zip | output.pptx


{
  "presentation": {
    "template": "template.pptx",
    "slides": [
      {
        "slide_index": 0,
        "shapes": [
          {
            "name": "Chart 1",
            "data": [
              [
                "series-a", 
                "series-b"
              ],
              [
                  5, 
                  2
              ],
              [
                  3, 
                  2.3
              ],
              [
                  4, 
                  1
              ],
              [
                  6, 
                  2.5
              ],
              [
                  4.5, 
                  1.8
              ],
              [
                  7, 
                  2.2
              ]
            ],
            "settings": {
              "isChartLabelValueVisible": false,
              "datapoints": [
                {
                  "isLabelValueVisible": true,
                  "categoryIndex": 0,
                  "seriesIndex": 0
                },
                {
                  "isLabelValueVisible": true,
                  "categoryIndex": 2,
                  "seriesIndex": 1
                },
                {
                  "isLabelValueVisible": true,
                  "categoryIndex": 5,
                  "seriesIndex": 0
                }
              ]
            }
          }
        ]
      }
    ]
  }
}

Last updated

Was this helpful?