Rally App SDK Experiments

by markmsmith

HTML

<script src="https://rally1.rallydev.com/apps/2.0p2/sdk-debug.js"></script>
<!DOCTYPE html>
<html>
<head>
    <title>Example Date Chart App</title>
</head>
<body>
</body>
</html>

JavaScript

var snapshotStore = Ext.create('Ext.data.Store', {
    fields: [{ name: 'KanbanState', type: 'date'},
             {name: 'ObjectID_Count', type: 'int'} ],
      data: {
          rows: [
              {KanbanState: Date.UTC(2012,6, 1, 8, 30, 0, 0), ObjectID_Count: 4},
              {KanbanState: Date.UTC(2012,6, 2, 8, 35, 0, 0), ObjectID_Count: 3},
              {KanbanState: Date.UTC(2012,6, 3, 8, 40, 0, 0), ObjectID_Count: 1},
              {KanbanState: Date.UTC(2012,6, 4, 8, 45, 0, 0), ObjectID_Count: 2}
          ]
      },
      proxy: {
          type: 'memory',
              reader: {
                  type: 'json',
                  root: 'rows'
          }
      }
  });
Ext.define('CustomApp', {
    extend: 'Rally.app.App',
    componentCls: 'app',
    layout: {
        type: 'vbox',
        align: 'stretch'
    },
    items:[
        {
            xtype: 'container',                    
            items: [
                
                {
                    xtype: 'rallychart',
                    height: 400,
                    width: 400,
                      series: [
                          {
                              type: 'column',
                              dataIndex: 'ObjectID_Count',
                              name: 'Count',
                              visible: true,
                              dataLabels: {
                                  formatter: function() {
                                      return this.y;
                                  }
                              }
                          }
                      ],
                    
                      // doesn't work
                      store: snapshotStore,
                    
                      // but this does
                      /*
                      series: [{
                          type: 'column',
                          data:[
                            [Date.UTC(2010, 0, 1), 29.9],
                           ...