Custom Chart Widget

Overview


The Custom Chart widget shows line charts or bar charts, from either spreadsheet or JSON data.




Getting Data into Dash


There are three different ways to get chart data into Dash:
  • Google Sheets
  • Fetch from URL
  • Push to Dash
The easiest way is probably from Google Sheets. You can import an Excel file or build your spreadsheet right on the site. They even have great collaborative editing so other people can update the widget data if you want.

The second way to get data into Dash is for us to fetch it from a URL that you specify. For example, this could be generated by a website or a file stored in Dropbox.

If you have a Pro or Business account, you also have the third option of pushing your data to us. This requires a little more work to set up, but it also means your updates will show up instantly.

The data you provide can be in either spreadsheet or JSON format (details below).

Graphing a Spreadsheet


If you're not sure whether to use a spreadsheet or JSON, we'd recommend trying a spreadsheet. It should look like this, regardless of whether you're using Google Sheets or Fetching CSV data:



The first column is the title for the datapoint. In this example it's a date, but it doesn't have to be. You can put whatever you want here and we'll display that on the X-Axis. We graph things in the order they're listed in the spreadsheet, so for this example I've made sure that the dates are increasing down the spreadsheet.

The other columns are the different series that you want to graph. The first value for each column is the title for that series. It's totally fine to have missing values in your data, so feel free to leave blank cells.

Graphing JSON


If you want to graph JSON data, it should follow this API:
{
  "graph" : {
    "title": "Body measurements",
    "datasequences" : [
      {
        "title" : "Chest Measurements",
        "datapoints" : [
          { "title" : "1-3-2012", "value" : 45.5 },
          { "title" : "1-10-2012", "value" : 45.5 },
          { "title" : "1-17-2012" },
          { "title" : "1-24-2012", "value" : 44.5 }
        ]
      },
      {
        "title" : "Narrowest waist point",
        "datapoints" : [
          { "title" : "1-3-2012", "value" : 38.6 },
          { "title" : "1-10-2012", "value" : 38.1 },
          { "title" : "1-17-2012", "value" : 38 },
          { "title" : "1-24-2012", "value" : 38 }
        ]
      }
    ]
  }
}
There are a couple of things to note with the JSON data format. First, the datapoints should be in the order that you want them graphed. Second, all series need to have all datapoints. If you don't want to graph a datapoint for a series, include the datapoint but don't include a value (as seen above). This way we know the order for all of the datapoints on the graph.

Maximum Data Size


Regardless of whether you use JSON or CSV data, we cap the size of the data you're trying to graph at 100kb.

Update Frequency


If you're using a push widget, your dashboard will update immediately when you send it new data. If you're using Google Drive or fetching from a URL, we currently grab new data for chart widgets every 60 seconds.

Suggestions


If you have any suggestions about how we can make the Custom Chart widget better, be sure to let us know!

Feedback and Knowledge Base