Full Example - Place highcharts element

Modified on Thu, 10 Sep 2020 at 12:42 PM

This is a copy&paste ready example from chapter 2) of the Apps - Getting started article.


{
  "version": "0.1",
  "screens": [
    {
      "layout": "layout1",
      "conditions": {
        "minScreenWidth": 0
      }
    }
  ],
  "layouts": [
    {
      "id": "layout1",
      "type": "fixedGrid",
      "config": {
        "dim": {
          "x": 24,
          "y": 24
        },
        "containers": [
          {
            "id": "titlePos",
            "pos": {
              "x": 1,
              "y": 1
            },
            "size": {
              "w": 24,
              "h": 4
            }
          },
          {
            "id": "chart1",
            "pos": {
              "x": 1,
              "y": 5
            },
            "size": {
              "w": 24,
              "h": 8
            }
          }
        ]
      },
      "cellPadding": "5px",
      "placements": [
        {
          "containerId": "titlePos",
          "elementId": "welcomeTitle"
        },
        {
          "containerId": "chart1",
          "elementId": "chartVis"
        }
      ]
    }
  ],
  "datasources": [
    {
      "id": "raw_testSource",
      "origin": "raw",
      "config": {
        "schema": "table",
        "data": [
          {
            "Categories": "Jan",
            "Berlin": 1.5,
            "Tokyo": 2.2,
            "New York": 2.3,
            "London": 1.1
          },
          {
            "Categories": "Feb",
            "Berlin": 2.1,
            "Tokyo": 2.8,
            "New York": 2.9,
            "London": 3.1
          },
          {
            "Categories": "Mar",
            "Berlin": 1.2,
            "Tokyo": 2.8,
            "New York": 2.1,
            "London": 2.4
          },
          {
            "Categories": "Apr",
            "Berlin": 0.2,
            "Tokyo": 4.2,
            "New York": 3.7,
            "London": 2.5
          }
        ]
      }
    }
  ],
  "elements": [
    {
      "id": "welcomeTitle",
      "type": "html",
      "config": {
        "html": "<h1>Hello World!</h1>"
      }
    },
    {
      "id": "chartVis",
      "type": "highcharts",
      "source": "raw_testSource",
      "config": {
        "title": {
          "text": "My Chart"
        },
        "subtitle": {
          "text": "My Untitled Chart"
        },
        "exporting": {},
        "chart": {
          "type": "line",
          "polar": false
        },
        "plotOptions": {
          "series": {
            "dataLabels": {
              "enabled": true
            },
            "animation": false
          }
        },
        "series": [
          {
            "name": "Tokyo",
            "turboThreshold": 0
          },
          {
            "name": "New York",
            "turboThreshold": 0
          },
          {
            "name": "Berlin",
            "turboThreshold": 0
          },
          {
            "name": "London",
            "turboThreshold": 0
          }
        ],
        "yAxis": {
          "title": {}
        }
      }
    }
  ]
}

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article