Clear Up
SharpKit Reference

ComponentConfig Class

Namespace: Ext.draw

Constructors

Name Description
ComponentConfig(Object[])

Fields

Name Description
autoSize Turn on autoSize support which will set the bounding div's size to the natural size of the contents. Defaults to: false
enginePriority Defines the priority order for which Surface implementation to use. The first one supported by the current environment will be used. Defaults to: ["Svg", "Vml"]
gradients (optional) Define a set of gradients that can be used as fill property in sprites. The gradients array is an array of objects with the following properties:
  • id - string - The unique name of the gradient.
  • angle - number, optional - The angle of the gradient in degrees.
  • stops - object - An object with numbers as keys (from 0 to 100) and style objects as values
  • Example
    gradients: [{
                id: 'gradientId',
                angle: 45,
                stops: {
                0: {
                color: '#555'
                },
                100: {
                color: '#ddd'
                }
                }
                }, {
                id: 'gradientId2',
                angle: 0,
                stops: {
                0: {
                color: '#590'
                },
                20: {
                color: '#599'
                },
                100: {
                color: '#ddd'
                }
                }
                }]
                
    Then the sprites can use gradientId and gradientId2 by setting the fill attributes to those ids, for example:
    sprite.setAttributes({
                fill: 'url(#gradientId)'
                }, true);
                
    items Array of sprites or sprite config objects to add initially to the surface.
    viewBox Turn on view box support which will scale and position items in the draw component to fit to the component while maintaining aspect ratio. Note that this scaling can override other sizing settings on your items. Defaults to: true
    © Copyright 2005-2011 SharpKit. All rights reserved.