Rev | Line | |
---|
[483] | 1 | define(["dojo/_base/declare", "./Columns", "./commonStacked"], |
---|
| 2 | function( declare, Columns, commonStacked){ |
---|
| 3 | |
---|
| 4 | return declare("dojox.charting.plot2d.StackedColumns", Columns, { |
---|
| 5 | // summary: |
---|
| 6 | // The plot object representing a stacked column chart (vertical bars). |
---|
| 7 | getSeriesStats: function(){ |
---|
| 8 | // summary: |
---|
| 9 | // Calculate the min/max on all attached series in both directions. |
---|
| 10 | // returns: Object |
---|
| 11 | // {hmin, hmax, vmin, vmax} min/max in both directions. |
---|
| 12 | var stats = commonStacked.collectStats(this.series); |
---|
| 13 | stats.hmin -= 0.5; |
---|
| 14 | stats.hmax += 0.5; |
---|
| 15 | return stats; // Object |
---|
| 16 | }, |
---|
| 17 | getValue: function(value, index, seriesIndex, indexed){ |
---|
| 18 | var x, y; |
---|
| 19 | if(indexed){ |
---|
| 20 | x = index; |
---|
| 21 | y = commonStacked.getIndexValue(this.series, seriesIndex, x); |
---|
| 22 | }else{ |
---|
| 23 | x = value.x - 1; |
---|
| 24 | y = commonStacked.getValue(this.series, seriesIndex, value.x); |
---|
| 25 | y = [ y[0]?y[0].y:null, y[1]?y[1]:null ]; |
---|
| 26 | } |
---|
| 27 | // in py we return the previous stack value as we need it to position labels on columns |
---|
| 28 | return { x: x, y: y[0], py: y[1] }; |
---|
| 29 | } |
---|
| 30 | }); |
---|
| 31 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.