API to create a new chart on BlobCity Visualisation

The API responds with a unique chart id cid that can be used to identify the new chart in future requests. The requester may desire to store the cid in an external system for future use. The cid is also an essential parameter for viewing the chart.

A chart requires data to load. This data can either be statically set for the chart and updated as or when required, or the chart maybe configured to load the data externally.

The following configurations options are available:

  • Statically set data
  • Configure a DB query for data load
  • Load data from a Stored Procedure on DB
  • Load data from an external API endpoint

Chart with DB Query
Configure a database query to fire on the chart. The query must define the datastore, collection, and the search terms along with aggregates, filtering, sort and limit options. Every time the chart is loaded, the chart is responsible for firing the corresponding query on the database. The chart will visually represent the data in DB at the time of loading the chart for the specifically configured query.

Chart with pre-set Data
Can be used for static charts, or charts that are updated periodically and are not to be loaded by a direct DB query. Also in some cases of charts a DB query may not be sufficient as the chart may have to take into account some complex data processing which a query alone may not be able to carry out.

An external service should be responsible for updating the chart data as and when required.

Chart on an API
Have the chart load from an external API endpoint. Each time the chart is loaded, the chart will invoke the external API. The external API may request parameters that are pre-configured onto the chart within the params object or are passed dynamically in the request to load this chart.

Parameters passed in request while loading the chart will always overwrite any chart level pre-defined parameters.

The API is responsible for returning data in the desired format of the respective chart for the chart to load successfully.

Chart on a Stored Procedure
The chart will invoke the specified stored procedure each time it is loaded. The stored procedure must be pre-loaded onto the DB using the load-code operation. The stored procedure is responsible for returning data in the desired format of the chart for the chart to be successfully loaded.

The chart will connect only to a pre-configured database. Cloud versions used from visual.blobcity.com are automatically routed to datastores on BlobCity Cloud DB. On-premise installations of BlobCity Visualisation route the request to the built in BlobCity DB installation that ships along with the BlobCity Visualisation product. On-premise installations may custom configure the DB route though.

Statically configured parameters as defined by the params object can be passed to the stored procedure, or parameters can be passed at runtime when chart is being loaded. Runtime passed parameters will always overwrite any static parameters set on the chart.

Click Try It! to start a request and see the response here!