Home Reference Source
public class | source

Chart

Base class, which includes common methods for all the charts

Constructor Summary

Public Constructor
public

constructor(d: any, config: any)

Non-instanciable Chart.

Member Summary

Public Members
public

config: *

public

data: *

public
public
public

events: *

Method Summary

Public Methods
public

change(property: any, value: any): *

Change a configuration property.

public

Make and download an image of the current state of the chart.

public

draw(data: any)

Paint data into the chart.

public

keepDrawing(datum: any, method: any)

This method add a data record / array of data into the current data.

Public Constructors

public constructor(d: any, config: any) source

Non-instanciable Chart. This is the parent class for all the ones (Linechart, Barchart, etc.)

Params:

NameTypeAttributeDescription
d any

Data. This object could be an array of data points or a datasource. Examples:

//With datasource
var data = {
      endpoint: 'ws://192.168.3.32:3000/barchart'
};
 var dataSource = new proteic.WebsocketDatasource(data);

barchart = new proteic.Barchart(dataSource);

//With data
barchart = new proteic.Barchart([{x:"SP", y:2},{x:"FR", y:6}]);

config any

Configuration of the chart.

Public Members

public config: * source

public data: * source

public datasource: * source

public dispatcher: * source

public events: * source

Public Methods

public change(property: any, value: any): * source

Change a configuration property. They all are also available through a method with the same name of the property.

Params:

NameTypeAttributeDescription
property any

property name

value any

the new property value

Return:

*

the instance of the current chart

public download() source

Make and download an image of the current state of the chart.

public draw(data: any) source

Paint data into the chart. If no data is specified, it takes by default the last dataset (very useful when repaintng charts )

Params:

NameTypeAttributeDescription
data any

Data to be painted

public keepDrawing(datum: any, method: any) source

This method add a data record / array of data into the current data.

Params:

NameTypeAttributeDescription
datum any
method any