| [7849] | 1 | package charts {
|
|---|
| 2 | import charts.series.Element;
|
|---|
| 3 | import charts.series.bars.Sketch;
|
|---|
| 4 | import string.Utils;
|
|---|
| 5 |
|
|---|
| 6 | public class BarSketch extends BarBase {
|
|---|
| 7 | private var outline_colour:Number;
|
|---|
| 8 | private var offset:Number;
|
|---|
| 9 |
|
|---|
| 10 | // TODO: remove
|
|---|
| 11 | protected var style:Object;
|
|---|
| 12 |
|
|---|
| 13 | public function BarSketch( json:Object, group:Number ) {
|
|---|
| 14 |
|
|---|
| 15 | //
|
|---|
| 16 | // these are specific values to the Sketch
|
|---|
| 17 | // and so we need to sort them out here
|
|---|
| 18 | //
|
|---|
| 19 | this.style = {
|
|---|
| 20 | 'outline-colour': "#000000",
|
|---|
| 21 | offset: 6
|
|---|
| 22 | };
|
|---|
| 23 |
|
|---|
| 24 | object_helper.merge_2( json, this.style );
|
|---|
| 25 |
|
|---|
| 26 | super( style, group );
|
|---|
| 27 | }
|
|---|
| 28 |
|
|---|
| 29 | //
|
|---|
| 30 | // called from the base object
|
|---|
| 31 | //
|
|---|
| 32 | protected override function get_element( index:Number, value:Object ): Element {
|
|---|
| 33 |
|
|---|
| 34 | var root:Properties = new Properties( {
|
|---|
| 35 | 'outline-colour': this.style['outline-colour'],
|
|---|
| 36 | offset: this.style.offset
|
|---|
| 37 | } );
|
|---|
| 38 |
|
|---|
| 39 | var default_style:Properties = this.get_element_helper_prop( value );
|
|---|
| 40 | default_style.set_parent( root );
|
|---|
| 41 |
|
|---|
| 42 | /**
|
|---|
| 43 | // our parent colour is a number, but
|
|---|
| 44 | // we may have our own colour:
|
|---|
| 45 | if( default_style.colour is String )
|
|---|
| 46 | default_style.colour = Utils.get_colour( default_style.colour );
|
|---|
| 47 |
|
|---|
| 48 | if ( !default_style['outline-colour'] )
|
|---|
| 49 | default_style['outline-colour'] = this.style['outline-colour'];
|
|---|
| 50 |
|
|---|
| 51 | if( default_style['outline-colour'] is String )
|
|---|
| 52 | default_style['outline-colour'] = Utils.get_colour( default_style['outline-colour'] );
|
|---|
| 53 |
|
|---|
| 54 | if ( !default_style.offset )
|
|---|
| 55 | default_style.offset = this.style.offset;
|
|---|
| 56 | **/
|
|---|
| 57 | return new Sketch( index, default_style, this.group );
|
|---|
| 58 | }
|
|---|
| 59 | }
|
|---|
| 60 | }
|
|---|