Skip to content

Commit

Permalink
Add the bar chart.
Browse files Browse the repository at this point in the history
  • Loading branch information
nelstrom committed Dec 13, 2012
1 parent c196a17 commit c85a2e9
Show file tree
Hide file tree
Showing 8 changed files with 192 additions and 8 deletions.
23 changes: 20 additions & 3 deletions .architect
@@ -1,10 +1,10 @@
{
"expandedState": {
"data": true,
"model": true,
"data": false,
"model": false,
"component": true,
"controller": true,
"resource": true,
"resource": false,
"00d49b68-1c14-48c1-b941-656b75d076fa": {
"id": "00d49b68-1c14-48c1-b941-656b75d076fa",
"cn": [
Expand Down Expand Up @@ -59,6 +59,23 @@
}
]
},
"028ad664-e816-43e4-b7b4-194958487411": {
"id": "028ad664-e816-43e4-b7b4-194958487411",
"cn": [
{
"id": "e6e8a8e7-b14a-4625-98fe-908d347727d2"
},
{
"id": "5cbcd515-300c-4244-b89c-eb1463274a0f"
},
{
"id": "e34b4987-4514-498d-bbfa-26d69d9f0f43"
},
{
"id": "370a9ea3-c00b-4538-9767-4662c786d869"
}
]
},
"76b625d5-78d0-426c-acc5-3f3f890702d2": {
"id": "76b625d5-78d0-426c-acc5-3f3f890702d2",
"expanded": false,
Expand Down
11 changes: 10 additions & 1 deletion CompanyStats.xds
Expand Up @@ -84,14 +84,23 @@
"app/store/StockDataStore.js"
],
"className": "StockDataStore"
},
"028ad664-e816-43e4-b7b4-194958487411": {
"paths": [
"metadata/view/CompanyBarChart",
"app/view/override/CompanyBarChart.js",
"app/view/CompanyBarChart.js"
],
"className": "CompanyBarChart"
}
},
"viewOrderMap": {
"view": [
"00d49b68-1c14-48c1-b941-656b75d076fa",
"be0a6884-f6d6-436f-8bc6-bd096763f018",
"92d27d78-73e9-4a38-9f7d-08c64c5d119c",
"7bce5aac-18fb-40af-9299-c695aa8259a4"
"7bce5aac-18fb-40af-9299-c695aa8259a4",
"028ad664-e816-43e4-b7b4-194958487411"
],
"store": [
"76b625d5-78d0-426c-acc5-3f3f890702d2",
Expand Down
3 changes: 2 additions & 1 deletion app.js
Expand Up @@ -30,7 +30,8 @@ Ext.application({
'Main',
'CompanyNavigation',
'CompanyDetail',
'ChartContainer'
'ChartContainer',
'CompanyBarChart'
],
controllers: [
'CompanyController'
Expand Down
1 change: 1 addition & 0 deletions app/controller/CompanyController.js
Expand Up @@ -64,6 +64,7 @@ Ext.define('ComStat.controller.CompanyController', {
} else {
if (titlebar.getTitle().match(/Bar/)) {
// add a CompanyBarChart to the chart container
cont.add({xtype:'companybarchart'});
} else {
Ext.StoreManager.lookup('StockDataStore').load();
// add a CompanyStockChart to the chart container
Expand Down
63 changes: 63 additions & 0 deletions app/view/CompanyBarChart.js
@@ -0,0 +1,63 @@
/*
* File: app/view/CompanyBarChart.js
*
* This file was generated by Sencha Architect version 2.2.0.
* http://www.sencha.com/products/architect/
*
* This file requires use of the Sencha Touch 2.1.x library, under independent license.
* License of Sencha Architect does not include license for Sencha Touch 2.1.x. For more
* details see http://www.sencha.com/license or contact license@sencha.com.
*
* This file will be auto-generated each and everytime you save your project.
*
* Do NOT hand edit this file.
*/

Ext.define('ComStat.view.CompanyBarChart', {
extend: 'Ext.chart.CartesianChart',
alias: 'widget.companybarchart',

config: {
store: 'CompanyStore',
colors: [
'#115fa6',
'#94ae0a',
'#a61120'
],
axes: [
{
type: 'category',
fields: [
'name'
]
},
{
type: 'numeric',
fields: [
'revenue'
],
grid: {
odd: {
fill: '#e8e8e8'
}
},
position: 'left'
}
],
series: [
{
type: 'bar',
xField: 'name',
yField: [
'revenue'
]
}
],
interactions: [
{
type: 'panzoom'
}
]
}

});
3 changes: 2 additions & 1 deletion metadata/Application
Expand Up @@ -18,7 +18,8 @@
"Main",
"CompanyNavigation",
"CompanyDetail",
"ChartContainer"
"ChartContainer",
"CompanyBarChart"
],
"controllers": [
"CompanyController"
Expand Down
5 changes: 3 additions & 2 deletions metadata/controller/CompanyController
Expand Up @@ -89,10 +89,11 @@
" cont.removeAll();",
"} else {",
" if (titlebar.getTitle().match(/Bar/)) {",
"\t\t// add a CompanyBarChart to the chart container",
" // add a CompanyBarChart to the chart container",
" cont.add({xtype:'companybarchart'});",
" } else {",
" Ext.StoreManager.lookup('StockDataStore').load();",
"\t\t// add a CompanyStockChart to the chart container",
" // add a CompanyStockChart to the chart container",
" }",
" main.setActiveItem('chartcontainer');",
" button.setText('hide chart');",
Expand Down
91 changes: 91 additions & 0 deletions metadata/view/CompanyBarChart
@@ -0,0 +1,91 @@
{
"type": "Ext.chart.CartesianChart",
"reference": {
"name": "items",
"type": "array"
},
"codeClass": null,
"userConfig": {
"designer|userClassName": "CompanyBarChart",
"designer|userAlias": "companybarchart",
"colors": [
"[",
" \"#115fa6\", ",
" \"#94ae0a\", ",
" \"#a61120\"",
"]"
],
"store": "CompanyStore"
},
"designerId": "028ad664-e816-43e4-b7b4-194958487411",
"iconCls": "icon-bar-chart",
"cn": [
{
"type": "Ext.chart.axis.Category",
"reference": {
"name": "axes",
"type": "array"
},
"codeClass": null,
"userConfig": {
"fields": [
"name"
],
"grid": null,
"designer|userClassName": "MyCategoryAxis"
},
"designerId": "e6e8a8e7-b14a-4625-98fe-908d347727d2"
},
{
"type": "Ext.chart.axis.Numeric",
"reference": {
"name": "axes",
"type": "array"
},
"codeClass": null,
"userConfig": {
"fields": [
"revenue"
],
"grid": [
"{",
" odd: {",
" fill: '#e8e8e8'",
" }",
"}"
],
"position": "left",
"designer|userClassName": "MyNumericAxis"
},
"designerId": "5cbcd515-300c-4244-b89c-eb1463274a0f"
},
{
"type": "Ext.chart.series.Bar",
"reference": {
"name": "series",
"type": "array"
},
"codeClass": null,
"userConfig": {
"designer|userClassName": "MyBarSeries",
"xField": "name",
"yField": [
"revenue"
]
},
"designerId": "e34b4987-4514-498d-bbfa-26d69d9f0f43"
},
{
"type": "Ext.chart.interactions.PanZoom",
"reference": {
"name": "interactions",
"type": "array"
},
"codeClass": null,
"userConfig": {
"designer|userClassName": "MyPanZoomInteraction"
},
"designerId": "370a9ea3-c00b-4538-9767-4662c786d869"
}
]
}

0 comments on commit c85a2e9

Please sign in to comment.