dojox/charting/plot2d/Columns.js

  • Provides:

    • dojox.charting.plot2d.Columns
  • Requires:

    • dojox.charting.plot2d.common in common
    • dojox.charting.plot2d.Base in common
    • dojox.gfx.fx in common
    • dojox.lang.utils in common
    • dojox.lang.functional in common
    • dojox.lang.functional.reversed in common
  • dojox.charting.plot2d.Columns

    • type
      Function
    • chains:
      • dojox.charting.plot2d.Base: (prototype)
      • dojox.charting.plot2d.Base: (call)
    • summary
      The constructor for a columns chart.
    • parameters:
      • chart: (typeof dojox.charting.Chart2D)
        The chart this plot belongs to.
      • kwArgs: (typeof dojox.charting.plot2d.__BarCtorArgs)
        An optional keyword arguments object to help define the plot.
    • source: [view]
         this.opt = dojo.clone(this.defaultParams);
         du.updateWithObject(this.opt, kwArgs);
         du.updateWithPattern(this.opt, kwArgs, this.optionalParams);
         this.series = [];
         this.hAxis = this.opt.hAxis;
         this.vAxis = this.opt.vAxis;
         this.animate = this.opt.animate;
  • dojox.charting.plot2d.Columns.defaultParams

    • type
      Object
    • summary
  • dojox.charting.plot2d.Columns.optionalParams

    • type
      Object
    • summary
  • dojox.charting.plot2d.Columns.getSeriesStats

    • type
      Function
    • source: [view]
         var stats = dc.collectSimpleStats(this.series);
         stats.hmin -= 0.5;
         stats.hmax += 0.5;
         return stats;
    • summary
      Calculate the min/max on all attached series in both directions.
    • return_summary
      Object
      {hmin, hmax, vmin, vmax} min/max in both directions.
  • dojox.charting.plot2d.Columns.render

    • type
      Function
    • parameters:
      • dim: (typeof Object)
        An object in the form of { width, height }
      • offsets: (typeof Object)
        An object of the form { l, r, t, b}.
    • source: [view]
         if(this.zoom && !this.isDataDirty()){
          return this.performZoom(dim, offsets);
         }
         this.resetEvents();
         this.dirty = this.isDirty();
         if(this.dirty){
          dojo.forEach(this.series, purgeGroup);
          this._eventSeries = {};
          this.cleanGroup();
          var s = this.group;
          df.forEachRev(this.series, function(item){ item.cleanGroup(s); });
         }
         var t = this.chart.theme, f, gap, width,
          ht = this._hScaler.scaler.getTransformerFromModel(this._hScaler),
          vt = this._vScaler.scaler.getTransformerFromModel(this._vScaler),
          baseline = Math.max(0, this._vScaler.bounds.lower),
          baselineHeight = vt(baseline),
          events = this.events();
         f = dc.calculateBarSize(this._hScaler.bounds.scale, this.opt);
         gap = f.gap;
         width = f.size;
         for(var i = this.series.length - 1; i >= 0; --i){
          var run = this.series[i];
          if(!this.dirty && !run.dirty){
           t.skip();
           this._reconnectEvents(run.name);
           continue;
          }
          run.cleanGroup();
          var theme = t.next("column", [this.opt, run]), s = run.group,
           eventSeries = new Array(run.data.length);
          for(var j = 0; j < run.data.length; ++j){
           var value = run.data[j];
           if(value !== null){
            var v = typeof value == "number" ? value : value.y,
             vv = vt(v),
             height = vv - baselineHeight,
             h = Math.abs(height),
             finalTheme = typeof value != "number" ?
              t.addMixin(theme, "column", value, true) :
              t.post(theme, "column");
            if(width >= 1 && h >= 1){
             var rect = {
              x: offsets.l + ht(j + 0.5) + gap,
              y: dim.height - offsets.b - (v > baseline ? vv : baselineHeight),
              width: width, height: h
             };
             var specialFill = this._plotFill(finalTheme.series.fill, dim, offsets);
             specialFill = this._shapeFill(specialFill, rect);
             var shape = s.createRect(rect).setFill(specialFill).setStroke(finalTheme.series.stroke);
             run.dyn.fill = shape.getFill();
             run.dyn.stroke = shape.getStroke();
             if(events){
              var o = {
               element: "column",
               index: j,
               run: run,
               shape: shape,
               x: j + 0.5,
               y: v
              };
              this._connectEvents(o);
              eventSeries[j] = o;
             }
             if(this.animate){
              this._animateColumn(shape, dim.height - offsets.b - baselineHeight, h);
             }
            }
           }
          }
          this._eventSeries[run.name] = eventSeries;
          run.dirty = false;
         }
         this.dirty = false;
         return this; // dojox.charting.plot2d.Columns
    • summary
      Run the calculations for any axes for this plot.
    • return_summary
      dojox.charting.plot2d.Columns
      A reference to this plot for functional chaining.
    • returns
      dojox.charting.plot2d.Columns
  • dojox.charting.plot2d.Columns._animateColumn

    • type
      Function
    • parameters:
      • shape: (typeof )
      • voffset: (typeof )
      • vsize: (typeof )
    • source: [view]
         dojox.gfx.fx.animateTransform(dojo.delegate({
          shape: shape,
          duration: 1200,
          transform: [
           {name: "translate", start: [0, voffset - (voffset/vsize)], end: [0, 0]},
           {name: "scale", start: [1, 1/vsize], end: [1, 1]},
           {name: "original"}
          ]
         }, this.animate)).play();
    • summary
  • dojox.charting.plot2d.Columns.defaultParams.hAxis

    • summary
  • dojox.charting.plot2d.Columns.defaultParams.vAxis

    • summary
  • dojox.charting.plot2d.Columns.defaultParams.gap

    • summary
  • dojox.charting.plot2d.Columns.defaultParams.animate

    • summary
  • dojox.charting.plot2d.Columns.optionalParams.minBarSize

    • summary
  • dojox.charting.plot2d.Columns.optionalParams.maxBarSize

    • summary
  • dojox.charting.plot2d.Columns.optionalParams.stroke

    • type
      Object
    • summary
  • dojox.charting.plot2d.Columns.optionalParams.outline

    • type
      Object
    • summary
  • dojox.charting.plot2d.Columns.optionalParams.shadow

    • type
      Object
    • summary
  • dojox.charting.plot2d.Columns.optionalParams.fill

    • type
      Object
    • summary
  • dojox.charting.plot2d.Columns.optionalParams.font

    • summary
  • dojox.charting.plot2d.Columns.optionalParams.fontColor

    • summary
  • dojox.charting.plot2d.Columns.dirty

    • summary
  • dojox.charting.plot2d.Columns._eventSeries

    • summary
  • dojox.charting.plot2d.Columns.opt

    • summary
  • dojox.charting.plot2d.Columns.series

    • summary
  • dojox.charting.plot2d.Columns.hAxis

    • summary
  • dojox.charting.plot2d.Columns.vAxis

    • summary
  • dojox.charting.plot2d.Columns.animate

    • summary
  • dc

    • summary
  • purgeGroup

    • summary
  • dojox.charting.plot2d

    • type
      Object
    • summary
  • dojox.charting

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary