X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..6e39d509471fe9b4e2660e0d1631b350d0c66f40:/pkgs/pkg-charts-debug.js
diff --git a/pkgs/pkg-charts-debug.js b/pkgs/pkg-charts-debug.js
index 020f854c..0d7f645d 100644
--- a/pkgs/pkg-charts-debug.js
+++ b/pkgs/pkg-charts-debug.js
@@ -1,5 +1,5 @@
/*!
- * Ext JS Library 3.0.0
+ * Ext JS Library 3.1.0
* Copyright(c) 2006-2009 Ext JS, LLC
* licensing@extjs.com
* http://www.extjs.com/license
@@ -792,7 +792,7 @@ Ext.FlashComponent = Ext.extend(Ext.BoxComponent, {
* @cfg {String} flashVersion
* Indicates the version the flash content was published for. Defaults to '9.0.45'.
*/
- flashVersion : '9.0.45',
+ flashVersion : '9.0.115',
/**
* @cfg {String} backgroundColor
@@ -805,6 +805,19 @@ Ext.FlashComponent = Ext.extend(Ext.BoxComponent, {
* The wmode of the flash object. This can be used to control layering. Defaults to 'opaque'.
*/
wmode: 'opaque',
+
+ /**
+ * @cfg {Object} flashVars
+ * A set of key value pairs to be passed to the flash object as flash variables. Defaults to undefined.
+ */
+ flashVars: undefined,
+
+ /**
+ * @cfg {Object} flashParams
+ * A set of key value pairs to be passed to the flash object as parameters. Possible parameters can be found here:
+ * http://kb2.adobe.com/cps/127/tn_12701.html Defaults to undefined.
+ */
+ flashParams: undefined,
/**
* @cfg {String} url
@@ -825,21 +838,28 @@ Ext.FlashComponent = Ext.extend(Ext.BoxComponent, {
initComponent : function(){
Ext.FlashComponent.superclass.initComponent.call(this);
- this.addEvents('initialize');
+ this.addEvents(
+ /**
+ * @event initialize
+ *
+ * @param {Chart} this
+ */
+ 'initialize'
+ );
},
onRender : function(){
Ext.FlashComponent.superclass.onRender.apply(this, arguments);
- var params = {
+ var params = Ext.apply({
allowScriptAccess: 'always',
bgcolor: this.backgroundColor,
wmode: this.wmode
- }, vars = {
+ }, this.flashParams), vars = Ext.apply({
allowedDomain: document.location.hostname,
elementID: this.getId(),
eventHandler: 'Ext.FlashEventProxy.onEvent'
- };
+ }, this.flashVars);
new swfobject.embedSWF(this.url, this.id, this.swfWidth, this.swfHeight, this.flashVersion,
this.expressInstall ? Ext.FlashComponent.EXPRESS_INSTALL_URL : undefined, vars, params);
@@ -909,17 +929,23 @@ Ext.FlashEventProxy = {
* @extends Ext.FlashComponent
* The Ext.chart package provides the capability to visualize data with flash based charting.
* Each chart binds directly to an Ext.data.Store enabling automatic updates of the chart.
+ * To change the look and feel of a chart, see the {@link #chartStyle} and {@link #extraStyle} config options.
* @constructor
* @xtype chart
*/
Ext.chart.Chart = Ext.extend(Ext.FlashComponent, {
refreshBuffer: 100,
+
+ /**
+ * @cfg {String} backgroundColor
+ * @hide
+ */
/**
* @cfg {Object} chartStyle
- * Sets styles for this chart. Contains a number of default values. Modifying this property will override
- * the base styles on the chart.
+ * Sets styles for this chart. This contains default styling, so modifying this property will override
+ * the built in styles of the chart. Use {@link #extraStyle} to add customizations to the default styling.
*/
chartStyle: {
padding: 10,
@@ -957,9 +983,75 @@ Ext.FlashEventProxy = {
/**
* @cfg {Object} extraStyle
* Contains extra styles that will be added or overwritten to the default chartStyle. Defaults to null.
+ * For a detailed list of the options available, visit the YUI Charts site
+ * at http://developer.yahoo.com/yui/charts/#basicstyles
+ * Some of the options availabe:
+ *
+ * - padding - The space around the edge of the chart's contents. Padding does not increase the size of the chart.
+ * - animationEnabled - A Boolean value that specifies whether marker animations are enabled or not. Enabled by default.
+ * - font - An Object defining the font style to be used in the chart. Defaults to { name: 'Tahoma', color: 0x444444, size: 11 }
+ *
+ * - name - font name
+ * - color - font color (hex code, ie: "#ff0000", "ff0000" or 0xff0000)
+ * - size - font size in points (numeric portion only, ie: 11)
+ * - bold - boolean
+ * - italic - boolean
+ * - underline - boolean
+ *
+ *
+ * - border - An object defining the border style around the chart. The chart itself will decrease in dimensions to accomodate the border.
+ *
+ * - color - border color (hex code, ie: "#ff0000", "ff0000" or 0xff0000)
+ * - size - border size in pixels (numeric portion only, ie: 1)
+ *
+ *
+ * - background - An object defining the background style of the chart.
+ *
+ * - color - border color (hex code, ie: "#ff0000", "ff0000" or 0xff0000)
+ * - image - an image URL. May be relative to the current document or absolute.
+ *
+ *
+ * - legend - An object defining the legend style
+ *
+ * - display - location of the legend. Possible values are "none", "left", "right", "top", and "bottom".
+ * - spacing - an image URL. May be relative to the current document or absolute.
+ * - padding, border, background, font - same options as described above.
+ *
+ * - dataTip - An object defining the style of the data tip (tooltip).
+ *
+ * - padding, border, background, font - same options as described above.
+ *
+ * - xAxis and yAxis - An object defining the style of the style of either axis.
+ *
+ * - color - same option as described above.
+ * - size - same option as described above.
+ * - showLabels - boolean
+ * - labelRotation - a value in degrees from -90 through 90. Default is zero.
+ *
+ * - majorGridLines and minorGridLines - An object defining the style of the style of the grid lines.
+ *
+ * - color, size - same options as described above.
+ *
+ * - zeroGridLine - An object defining the style of the style of the zero grid line.
+ *
+ * - color, size - same options as described above.
+ *
+ * - majorTicks and minorTicks - An object defining the style of the style of ticks in the chart.
+ *
+ * - color, size - same options as described above.
+ * - length - the length of each tick in pixels extending from the axis.
+ * - display - how the ticks are drawn. Possible values are "none", "inside", "outside", and "cross".
+ *
+ *
*/
extraStyle: null,
+ /**
+ * @cfg {Object} seriesStyles
+ * Contains styles to apply to the series after a refresh. Defaults to null.
+ */
+ seriesStyles: null,
+
/**
* @cfg {Boolean} disableCaching
* True to add a "cache buster" to the end of the chart url. Defaults to true for Opera and IE.
@@ -982,7 +1074,20 @@ Ext.FlashEventProxy = {
'itemdoubleclick',
'itemdragstart',
'itemdrag',
- 'itemdragend'
+ 'itemdragend',
+ /**
+ * @event beforerefresh
+ * Fires before a refresh to the chart data is called. If the beforerefresh handler returns
+ * false the {@link #refresh} action will be cancelled.
+ * @param {Chart} this
+ */
+ 'beforerefresh',
+ /**
+ * @event refresh
+ * Fires after the chart data has been refreshed.
+ * @param {Chart} this
+ */
+ 'refresh'
);
this.store = Ext.StoreMgr.lookup(this.store);
},
@@ -1012,6 +1117,7 @@ Ext.FlashEventProxy = {
* @param styles {Array} Initializer for all Chart series styles.
*/
setSeriesStyles: function(styles){
+ this.seriesStyles = styles;
var s = [];
Ext.each(styles, function(style){
s.push(Ext.encode(style));
@@ -1043,13 +1149,14 @@ Ext.FlashEventProxy = {
*/
bindStore : function(store, initial){
if(!initial && this.store){
- this.store.un("datachanged", this.refresh, this);
- this.store.un("add", this.delayRefresh, this);
- this.store.un("remove", this.delayRefresh, this);
- this.store.un("update", this.delayRefresh, this);
- this.store.un("clear", this.refresh, this);
if(store !== this.store && this.store.autoDestroy){
this.store.destroy();
+ }else{
+ this.store.un("datachanged", this.refresh, this);
+ this.store.un("add", this.delayRefresh, this);
+ this.store.un("remove", this.delayRefresh, this);
+ this.store.un("update", this.delayRefresh, this);
+ this.store.un("clear", this.refresh, this);
}
}
if(store){
@@ -1074,7 +1181,7 @@ Ext.FlashEventProxy = {
this.swf.setType(this.type);
if(this.chartStyle){
- this.setStyles(Ext.apply(this.extraStyle || {}, this.chartStyle));
+ this.setStyles(Ext.apply({}, this.extraStyle, this.chartStyle));
}
if(this.categoryNames){
@@ -1098,51 +1205,57 @@ Ext.FlashEventProxy = {
},
refresh : function(){
- var styleChanged = false;
- // convert the store data into something YUI charts can understand
- var data = [], rs = this.store.data.items;
- for(var j = 0, len = rs.length; j < len; j++){
- data[j] = rs[j].data;
+ if(this.fireEvent('beforerefresh', this) !== false){
+ var styleChanged = false;
+ // convert the store data into something YUI charts can understand
+ var data = [], rs = this.store.data.items;
+ for(var j = 0, len = rs.length; j < len; j++){
+ data[j] = rs[j].data;
+ }
+ //make a copy of the series definitions so that we aren't
+ //editing them directly.
+ var dataProvider = [];
+ var seriesCount = 0;
+ var currentSeries = null;
+ var i = 0;
+ if(this.series){
+ seriesCount = this.series.length;
+ for(i = 0; i < seriesCount; i++){
+ currentSeries = this.series[i];
+ var clonedSeries = {};
+ for(var prop in currentSeries){
+ if(prop == "style" && currentSeries.style !== null){
+ clonedSeries.style = Ext.encode(currentSeries.style);
+ styleChanged = true;
+ //we don't want to modify the styles again next time
+ //so null out the style property.
+ // this causes issues
+ // currentSeries.style = null;
+ } else{
+ clonedSeries[prop] = currentSeries[prop];
+ }
+ }
+ dataProvider.push(clonedSeries);
+ }
+ }
+
+ if(seriesCount > 0){
+ for(i = 0; i < seriesCount; i++){
+ currentSeries = dataProvider[i];
+ if(!currentSeries.type){
+ currentSeries.type = this.type;
+ }
+ currentSeries.dataProvider = data;
+ }
+ } else{
+ dataProvider.push({type: this.type, dataProvider: data});
+ }
+ this.swf.setDataProvider(dataProvider);
+ if(this.seriesStyles){
+ this.setSeriesStyles(this.seriesStyles);
+ }
+ this.fireEvent('refresh', this);
}
- //make a copy of the series definitions so that we aren't
- //editing them directly.
- var dataProvider = [];
- var seriesCount = 0;
- var currentSeries = null;
- var i = 0;
- if(this.series){
- seriesCount = this.series.length;
- for(i = 0; i < seriesCount; i++){
- currentSeries = this.series[i];
- var clonedSeries = {};
- for(var prop in currentSeries){
- if(prop == "style" && currentSeries.style !== null){
- clonedSeries.style = Ext.encode(currentSeries.style);
- styleChanged = true;
- //we don't want to modify the styles again next time
- //so null out the style property.
- // this causes issues
- // currentSeries.style = null;
- } else{
- clonedSeries[prop] = currentSeries[prop];
- }
- }
- dataProvider.push(clonedSeries);
- }
- }
-
- if(seriesCount > 0){
- for(i = 0; i < seriesCount; i++){
- currentSeries = dataProvider[i];
- if(!currentSeries.type){
- currentSeries.type = this.type;
- }
- currentSeries.dataProvider = data;
- }
- } else{
- dataProvider.push({type: this.type, dataProvider: data});
- }
- this.swf.setDataProvider(dataProvider);
},
createFnProxy : function(fn, old){
@@ -1156,7 +1269,11 @@ Ext.FlashEventProxy = {
onDestroy: function(){
Ext.chart.Chart.superclass.onDestroy.call(this);
- delete window[this.tipFnName];
+ this.bindStore(null);
+ var tip = this.tipFnName;
+ if(!Ext.isEmpty(tip)){
+ delete window[tip];
+ }
}
});
Ext.reg('chart', Ext.chart.Chart);