Package muntjac :: Package addon :: Package invient :: Module invient_charts :: Class InvientCharts
[hide private]
[frames] | no frames]

Class InvientCharts

source code

                          object --+                
                                   |                
                 util.IEventListener --+            
                                       |            
           terminal.paintable.IPaintable --+        
                                           |        
                              object --+   |        
                                       |   |        
  terminal.variable_owner.IVariableOwner --+        
                                           |        
                              object --+   |        
                                       |   |        
             terminal.sizeable.ISizeable --+        
                                           |        
                     ui.component.IComponent --+    
                                               |    
                                  object --+   |    
                                           |   |    
event.method_event_source.IMethodEventSource --+    
                                               |    
         ui.abstract_component.AbstractComponent --+
                                                   |
                                                  InvientCharts

A Muntjac component representing charts. It is a the main class of
InvientCharts library.

A chart typically contains one or more series of same or different types.
This class allows us to specify series of different types say line and pie
and hence it makes it easy to build a combination chart.

After a chart L{InvientCharts} is created, the following changes to the
chart will be reflected rendered on the webkit.

  * Set or update chart L{Title} and/or L{SubTitle}
  * Modify chart size
  * Add, update and remove one or more instances of L{PlotBand} and
    L{PlotLine}
  * Set or update axis categories
  * Set or update axis min and max values
  * Add, update and remove one or more instances of L{Series}
  * Show or hide one or more instances of L{Series}
  * Add and remove one or more instances of L{Point}
  * Register and unregister event listeners

@author: Invient
@author: Richard Lincoln

Instance Methods [hide private]
 
__init__(self, chartConfig)
Creates this chart object with given chart configuration
source code
 
getConfig(self)
Returns chart configuration object
source code
 
paintContent(self, target)
Paints any needed component-specific things to the given UIDL stream.
source code
 
paintChartEvents(self, target) source code
 
paintSeriesAndPointEvents(self, target) source code
 
paintSeriesEvents(self, target, seriesType) source code
 
paintPointEvents(self, target, seriesType) source code
 
changeVariables(self, source, variables)
Called when one or more variables handled by the implementing class are changed.
source code
 
getPointFromEventData(self, eventData) source code
 
getSeriesFromEventData(self, seriesName) source code
 
fireAddSeries(self) source code
 
fireChartClick(self, point, mousePosition) source code
 
fireChartZoom(self, selectedArea) source code
 
fireChartSVGAvailable(self, svg) source code
 
fireChartResetZoom(self) source code
 
fireSeriesClick(self, series, point, mousePosition) source code
 
fireSeriesShow(self, series) source code
 
fireSeriesHide(self, series) source code
 
fireSeriesLegendItemClick(self, series) source code
 
firePointClick(self, category, point, mousePosition) source code
 
firePointSelect(self, category, point) source code
 
firePointUnselect(self, category, point) source code
 
firePointRemove(self, category, point) source code
 
fireLegendItemClick(self, point) source code
 
getPointEventData(self, eventData) source code
 
getClickPosition(self, eventData) source code
 
addListener(self, listener, seriesTypes=None)
Adds the listener.
source code
 
removeListener(self, listener, seriesTypes=None)
Removes the listener.
source code
 
setSeries(self, series)
The data of a chart is defined in terms of Series.
source code
 
getSeries(self, name)
Returns a series whose name matches the argument name.
source code
 
getAllSeries(self)
Returns all series associated with this chart.
source code
 
addSeries(self, seriesData)
Adds the argument series to this chart.
source code
 
setAxisInAllSeriesIfNotSetAlready(self) source code
 
setAxisInSeriesIfNotSetAlready(self, series) source code
 
removeSeries(self, name_or_seriesData)
Removes a series whose name matches the argument name or the argument seriesData from this chart.
source code
 
addSeriesCUROperation(self, newSeriesCUR) source code
 
addSeriesPointAddedOperation(self, seriesName, point) source code
 
getLastSeriesCUR(self, seriesCURSet) source code
 
getMatchedSeriesCUR(self, seriesCURSet, matchAgainstSeriesCUR) source code
 
addSeriesPointRemovedOperation(self, seriesName, point) source code
 
refresh(self)
After a series is added or removed, there is no need to call this method as it is handled implicitly.
source code
 
print_(self)
Displays a Print dialog of the Webkit to print this chart.
source code

Inherited from ui.abstract_component.AbstractComponent: __getstate__, __setstate__, addCallback, addStyleName, attach, childRequestedRepaint, detach, fireComponentErrorEvent, fireComponentEvent, fireEvent, fireRequestRepaintEvent, focus, getApplication, getCSSHeight, getCSSWidth, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorHandler, getErrorMessage, getHeight, getHeightUnits, getIcon, getListeners, getLocale, getParent, getStyle, getStyleName, getWidth, getWidthUnits, getWindow, handleError, hasListeners, isEnabled, isImmediate, isReadOnly, isVisible, paint, parseStringSize, registerCallback, registerListener, removeCallback, removeStyleName, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setData, setDebugId, setDescription, setEnabled, setErrorHandler, setHeight, setHeightUnits, setIcon, setImmediate, setLocale, setParent, setReadOnly, setSizeFull, setSizeUndefined, setStyle, setStyleName, setVisible, setWidth, setWidthUnits, withdrawCallback, withdrawListener

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  CLIENT_WIDGET = None
hash(x)
  TYPE_MAPPING = 'com.invient.vaadin.charts.InvientCharts'

Inherited from ui.abstract_component.AbstractComponent: SIZE_PATTERN

Inherited from terminal.sizeable.ISizeable: SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS, UNIT_SYMBOLS

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, chartConfig)
(Constructor)

source code 

Creates this chart object with given chart configuration

@param chartConfig

Overrides: object.__init__

getConfig(self)

source code 

Returns chart configuration object

Returns:
Returns chart configuration object

paintContent(self, target)

source code 

Paints any needed component-specific things to the given UIDL stream. The more general paint method handles all general attributes common to all components, and it calls this method to paint any component-specific attributes to the UIDL stream.

Parameters:
  • target - the target UIDL stream where the component should paint itself to
Raises:
Overrides: ui.abstract_component.AbstractComponent.paintContent
(inherited documentation)

changeVariables(self, source, variables)

source code 

Called when one or more variables handled by the implementing class are changed.

Parameters:
  • source - the Source of the variable change. This is the origin of the event. For example in Web Adapter this is the request.
  • variables - the Mapping from variable names to new variable values.
Overrides: terminal.variable_owner.IVariableOwner.changeVariables
(inherited documentation)

addListener(self, listener, seriesTypes=None)

source code 

Adds the listener. If the argument seriesTypes is not specified then the listener will be added for all series type otherwise it will be added for a specific series type

Parameters:
  • listener - the IListener to be added.
Raises:
  • ValueError - unless method has a match in object
Overrides: event.method_event_source.IMethodEventSource.addListener

removeListener(self, listener, seriesTypes=None)

source code 

Removes the listener. If the argument seriesTypes is not specified then the listener will be removed only for a series type SeriesType.COMMONSERIES otherwise the listener will be removed for all specified series types.

Parameters:
  • listener - the listener to be removed
  • seriesTypes - one or more series types as defined by SeriesType
Overrides: event.method_event_source.IMethodEventSource.removeListener

setSeries(self, series)

source code 

The data of a chart is defined in terms of Series. This method removes all previously set series of this chart and adds the argument series. If the argument series is null then no actions are taken.

Parameters:
  • series - A collection of series to set as chart's data

getSeries(self, name)

source code 

Returns a series whose name matches the argument name.

Parameters:
  • name - the name of the series
Returns:
Returns a series with the given name

getAllSeries(self)

source code 

Returns all series associated with this chart.

Returns:
returns all series associated with this chart.

addSeries(self, seriesData)

source code 

Adds the argument series to this chart.

Parameters:
  • seriesData - the series to be added

removeSeries(self, name_or_seriesData)

source code 

Removes a series whose name matches the argument name or the argument seriesData from this chart.

Parameters:
  • seriesData - the name of the series or the series object to be removed

refresh(self)

source code 

After a series is added or removed, there is no need to call this method as it is handled implicitly. This method will send updates to the client. This method should be called after adding/removing plotbands and plotlines. This inconsistency will be fixed in next revision.

print_(self)

source code 

Displays a Print dialog of the Webkit to print this chart. Invoking this method causes the Webkit to hide other widgets on the screen and only this chart widget will be visible. Also it prints this chart widget as it is displayed.