trueChart API Documentation

General information

trueChart is a complex visualization solution. Its key features are a consistent scaling factor across multiple instances and an interactive commenting interface, making annotations to charts anywhere in the document, synchronizing (meta-)data between instances and even with a central service running in the cloud.

Therefore, the setup of the product may get complex, but this API follows a top-down approach, where you can just throw a bunch of charts on the screen with minimal configuration and then dive into the depths of configuration step-by-step, making changes only where needed.

The trueChart API has methods for managing instances, setting parameters on a global scope and configuring behaviour, layout and data per instance.

Additionally there is this concept of "Features": the implementation of some functionality highly depends on the target platform, like the evaluation of BI-variables and expressions or the loading and saving of document properties. For these action we prepared a clean interface where external implementation of these methods can be hooked on.

Please see the according sub-pages for an extensive documentation.

Configuration interfaces

Instance management functions

Global configuration

Instance configuration

Each trueChart instance has access to the following interfaces:

Typical usage

  // referencing the API in a local variable for quicker access
  var TC_API = window['TrueChartCore_API'];

  // setting config 
  TC_API.ConfigManager.setConfig({
    documentLocation: "localhost",
    documentName: "example",
    documentTitle: document.title,
    getServerId: sourceObject => sourceObject.element.id,
    user: { username: "Me" }
  });

  // creating an trueChart instance inside an existing DIV
  var tc = TC_API.createTrueChart(document.getElementById("truechart"));

  // adding data
  var data = tc.DataManager.addDataSource("My Data");

  data.addDimension({
      name: "Region",
      type: "text"
  }, ["Region 1", "Region 2", "Region 3"]);

  data.addMeasure({
      name: "Population",
      type: "number"
  }, [5600, 6800, 4200]);

  // trigger show
  tc.show();

Index