Charts

Generate a chart image

Render a line, bar, horizontal-bar or world-map chart from a dataset as PNG/JPEG (base64 or URL).

post/api/charts/generate-png

Request

  • Base URL: https://monit.ly
  • URL: https://monit.ly/api/charts/generate-png
  • Auth: API key in header X-API-Key

Request body

datasetIdinteger required
chartType'line' | 'bar' | 'map' | 'horizontal-bar' required
selectedDimensionsobject
dimensions_querystring

Same format as /data query, e.g. dim1=Annual&dim2=...

periodstring

Single period for map / horizontal-bar

seriesColorsobject
customLegendLabelsobject
customTitlestring
widthinteger
heightinteger
includeTitleboolean
includeSourceboolean
includeDateboolean
highlightLatestboolean
showValuesboolean
showBordersboolean
showLegendboolean
mapLocation'europe' | 'asia' | 'africa' | 'north-america' | 'south-america' | 'oceania'
additionalTextstring
format'json' | 'png' | 'jpeg'

Example request

{
  "datasetId": 2973,
  "selectedDimensions": {
    "country": [
      "Austria",
      "Poland"
    ]
  },
  "width": 800,
  "height": 400
}

Response

Chart image

successboolean
base64string
urlstring

Changes

No recorded changes to this operation across all 1 revision of this API.