graph » widgets

widgets

[ root » graph » widgets ]

A way to extend default ZingChart functionality with object syntax. Refer to the Widgets Tutorial for more information.

Original JSON:
  ...
  widgets: [{
    type: "myWidget",
    x: 100,
    y: 200,
    ...
  }]
  ...
  JavaScript Code:
  ...
  zingchart.widgets.myWidget = {
    parse : function(data) {
      return {
        graphs: [{...}],
        labels: [{...}],
        shapes: [{...}]
      };
    }   
  };


AttributeTypeDescription
OBJECT_KEY_NAMEAnyCustom configuration data for widget.
typeStringType of the widget. The zingchart.widgets.myWidget object must exist and define a parse method returning an object with graphs, labels, and shapes collections which will be injected in the original JSON.