Clear Up
SharpKit Reference

Label Interface

Labels is a mixin to the Series class. Labels methods are implemented in each of the Series (Pie, Bar, etc) for label creation and placement.

The methods implemented by the Series are:

  • onCreateLabel(storeItem, item, i, display) Called each time a new label is created. The arguments of the method are:

    • storeItem The element of the store that is related to the label sprite.
    • item The item related to the label sprite. An item is an object containing the position of the shape used to describe the visualization and also pointing to the actual shape (circle, rectangle, path, etc).
    • i The index of the element created (i.e the first created label, second created label, etc)
    • display The display type. May be false if the label is hidden
  • onPlaceLabel(label, storeItem, item, i, display, animate) Called for updating the position of the label. The arguments of the method are:

    • label The sprite label.
  • storeItem The element of the store that is related to the label sprite
  • item The item related to the label sprite. An item is an object containing the position of the shape used to describe the visualization and also pointing to the actual shape (circle, rectangle, path, etc).
  • i The index of the element to be updated (i.e. whether it is the first, second, third from the labelGroup)
  • display The display type. May be false if the label is hidden.
  • animate A boolean value to set or unset animations for the labels.

Namespace: Ext.chart

Properties

Name Description
className Defaults to: "Ext.Base"
configMap Defaults to: {}
initConfigList Defaults to: []
initConfigMap Defaults to: {}
isInstance Defaults to: true
self Get the reference to the current class from which this object was instantiated. Unlike statics, this.self is scope-dependent and it's meant to be used for dynamic inheritance. See statics for a detailed comparison
  Ext.define('My.Cat', {
            statics: {
            speciesName: 'Cat' // My.Cat.speciesName = 'Cat'
            },
            constructor: function() {
            alert(this.self.speciesName); // dependent on 'this'
            },
            clone: function() {
            return new this.self();
            }
            });
            Ext.define('My.SnowLeopard', {
            extend: 'My.Cat',
            statics: {
            speciesName: 'Snow Leopard'         // My.SnowLeopard.speciesName = 'Snow Leopard'
            }
            });
            var cat = new My.Cat();                     // alerts 'Cat'
            var snowLeopard = new My.SnowLeopard();     // alerts 'Snow Leopard'
            var clone = snowLeopard.clone();
            alert(Ext.getClassName(clone));             // alerts 'My.SnowLeopard'
            
© Copyright 2005-2011 SharpKit. All rights reserved.