Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this example we are showing weather data from the Gold Coast using the openweathermap.org API

Key
Requried
RequiredDescription
Name
(tick)
(tick)Name of the component which is shown under the opCharts data sources when creating a dashboard
data_source_type
(tick)
(tick)remote_json is used for opCharts to know it needs to make this type of request
model_view
(tick)
(tick)opmantek-remote-json name of the component which visually shows the data
options.titleText
(tick)
(tick)Title of the component shown on the dashboard
remote_paramaters.url
(tick)
(tick)URL of your endpoint which returns JSON data
remote_paramaters.auth_type

remote_paramaters.data_key

remote_paramaters.pagination

private.token
Opmantek Token Auth
table_schema


Code Block
languagejs
titleexample_gold_coast_weather.json
{
  "name": "Weather in Gold Coast, AU",
  "data_source_type" : "remote_json",
  "model_view" : "opmantek-remote-json",
  "options": {
    "titleText": "Weather in Gold Coast, AU"
  },
  "remote_paramaters": {
    "pagination": "client",
    "url": "https://api.openweathermap.org/data/2.5/forecast?id=2165087&APPID=__YOUR__API__KEY__&units=metric",
    "data_key": "list"
  },
  "table_schema": [
    { "name": "dt",
      "label": "Timestamp",
      "cell": "String",
      "formatter": "UnixTime",
      "editable": false
    },
    { "name": "wind.speed",
      "label": "Wind Speed",
      "cell": "ColouredByLevel",
      "levels": ["red", 75, "orange", 50, "yellow", 25, "green", 0],
      "editable": false
    },
    { "name": "main.temp",
      "label": "Temp",
      "cell": "ColouredByLevel",
      "editable": false,
      "levels": ["red", 30, "orange", 25, "yellow", 18, "green", 0]
    },
    { "name": "wind.deg",
      "label": "Wind Direction",
      "cell": "String",
      "editable": false
    },
    { "name": "main.pressure",
      "label": "Pressure",
      "cell": "String",
      "editable": false
    },
    { "name": "main.humidity",
      "label": "Humidity",
      "cell": "ColouredByLevel",
      "levels": ["red", 75, "orange", 50, "yellow", 25, "green", 0],
      "editable": false
    },
    { "name": "weather.0.description",
      "label": "Forcast",
      "cell": "String",
      "editable": false
    }
  ]
}

...