Data Streaming Charts JSON Data Format |
Starting FusionWidgets XT, charts/gauges can be rendered using JSON (JavaScript Object Notation) data. JSON is a light-weight and simple data format that is easy to read and understand. Though derived from JavaScript, the data structure is language-independent, with encoders and parsers available for virtually every programming language.
A FusionWidgets XT chart or gauge is controlled by a single JSON data source i.e., the same source contains data to plot, functional settings and cosmetic properties. There are many properties that you can define for each chart type. However, it is not necessary to define all the properties for a given chart. For example, if you do not want to change the default setting of the canvas (color, alpha etc.), you don't have to define any property for the canvas - the default values will be assumed. Thus, each chart can be generated using minimal properties. |
The JSON data structure for all the data streaming charts is same. A sample JSON data for a Real-time Column chart looks as under: { |
Brief Explanation |
The chart Object defines all the settings that help to manipulate the chart. You can find the list of all the attributes for this Object in the XML Sheet of each chart. In the most general form, chart attributes represent the following JSON format: For data streaming charts, we have specified the following properties within the chart Object:
When providing the datastreamurl path in JSON, please ensure the following:
Please note that the XML attributes declared in the XML Sheets for each data streaming chart are same as the JSON keys in FusionWidgets XT JSON data format. The categories Array is a collection of the category Objects and defines the x-axis labels. Each category item represents a label on the x-axis. The category elements need to be defined for all the real-time charts before you can define the data. For example, in our chart, the categories represent the time period. "categories": [ All data series for the chart are defined through the dataset Array. Each data series represents an Object in the dataset Array. The two data series being plotted in this chart are stock prices for Google and Dell. Depending on the chart type, there are a number of properties which you can define as key-value pairs in each data series Object. The actual data for the data series is provided through a data Array. The data Array contains a set of Objects, each providing a single data value through the value property. "dataset": [ |
The styles Object helps you apply font, effects and animations to various objects of the chart. In FusionWidgets XT JSON format, the styles Object contains two Arrays - definition and application. The definition Array contains a list of style Objects. Each style Object contains various style definition attributes. The application Array contains a list of apply Objects. Each apply Object contains attributes to apply styles that are defined in the definition Array to various chart objects. To read more on Styles, please see Using Styles section. Important: To use JSON data format with FusionWidgets XT, you'll need to embed the charts using FusionCharts JavaScript Class (FusionCharts.js), as the charts internally still use XML. The JavaScript class provides the bridge between JSON and XML. |