-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support ExtJs 5 and Solid Gauge series
- Loading branch information
Joe
authored and
Joe
committed
Sep 14, 2014
1 parent
1c6a2c7
commit 79d0920
Showing
115 changed files
with
4,742 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,15 +2,15 @@ | |
* @author | ||
* Joe Kuan <[email protected]> | ||
* | ||
* version 3.0.2 | ||
* version 3.1.0 | ||
* | ||
* <!-- You are not permitted to remove the author section (above) from this file. --> | ||
* | ||
* Documentation last updated: 28 May 2014 | ||
* Documentation last updated: 14 Sept 2014 | ||
* | ||
* A much improved & ported from ExtJs 3 Highchart adapter. | ||
* | ||
* - Supports the latest Highcharts | ||
* - Supports the latest Highcharts 5 | ||
* - Supports both Sencha ExtJs 4 and Touch 2 | ||
* - Supports Highcharts animations | ||
* - Supports Highmaps | ||
|
@@ -188,7 +188,7 @@ Ext.define("Chart.ux.Highcharts", { | |
* @static | ||
* Version string of the current Highcharts extension | ||
*/ | ||
version: '3.0.2', | ||
version: '3.1.0', | ||
|
||
/*** | ||
* @property {Object} sencha | ||
|
@@ -230,7 +230,7 @@ Ext.define("Chart.ux.Highcharts", { | |
* @property {Boolean} debug | ||
* Switch on the debug logging to the console | ||
*/ | ||
debug: true, | ||
debug: false, | ||
|
||
switchDebug : function() { | ||
this.debug = true; | ||
|
@@ -355,7 +355,6 @@ Ext.define("Chart.ux.Highcharts", { | |
afterChartRendered: null, | ||
|
||
constructor: function(config) { | ||
console.log(config); | ||
config.listeners && (this.afterChartRendered = config.listeners.afterChartRendered); | ||
this.afterChartRendered && (this.afterChartRendered = Ext.bind(this.afterChartRendered, this)); | ||
if (config.animation == false) { | ||
|
@@ -651,17 +650,19 @@ console.log(config); | |
} | ||
} | ||
|
||
for( i = 0; i < _this.series.length; i++) { | ||
if(!_this.series[i].visible) | ||
_this.chart.series[i].hide(); | ||
} | ||
if (Ext.isArray(_this.series)) { | ||
for( i = 0; i < _this.series.length; i++) { | ||
if(!_this.series[i].visible) | ||
_this.chart.series[i].hide(); | ||
} | ||
|
||
// Refresh the data only if it is not loading | ||
// no point doing this, as onLoad will pick it up | ||
if (this.store && !this.store.isLoading()) { | ||
this.log("Call refresh from draw"); | ||
this.refresh(); | ||
} | ||
// Refresh the data only if it is not loading | ||
// no point doing this, as onLoad will pick it up | ||
if (this.store && !this.store.isLoading()) { | ||
this.log("Call refresh from draw"); | ||
this.refresh(); | ||
} | ||
} | ||
}, | ||
|
||
/*** | ||
|
@@ -813,9 +814,10 @@ console.log(config); | |
serie.bindRecord && (point.record = record); | ||
data[i].push(point); | ||
} | ||
} else if (serie.type == 'gauge') { | ||
} else if (serie.type == 'gauge' || serie.type == 'solidgauge') { | ||
// Gauge is a dial type chart, so the data can only | ||
// have one value | ||
console.log(record); | ||
data[i][0] = serie.getData(record, x); | ||
} else if (serie.data && serie.data.length) { | ||
// This means the series is added within its own data | ||
|
@@ -1016,7 +1018,6 @@ console.log(config); | |
if(!this.updateTask) { | ||
this.updateTask = new Ext.util.DelayedTask(this.draw, this); | ||
} | ||
console.log("update delay " + cdelay); | ||
this.updateTask.delay(cdelay); | ||
}, | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* Serie class for solid gauge series type | ||
* | ||
* See {@link Chart.ux.Highcharts.Serie} class for more info | ||
* | ||
* SolidGauge series is a one dimensional series type, i.e only y-axis data | ||
*/ | ||
Ext.define('Chart.ux.Highcharts.SolidGaugeSerie', { | ||
extend : 'Chart.ux.Highcharts.Serie', | ||
alternateClassName: [ 'highcharts.solidgauge' ], | ||
type : 'solidgauge' | ||
|
||
/*** | ||
* @cfg xField | ||
* @hide | ||
*/ | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#banner .x-panel-header { | ||
padding-left: 10px; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
Ext.Loader.setConfig({ | ||
enabled : true, | ||
disableCaching : true, // For debug only | ||
paths : { | ||
// 'Chart' : HOME + '/highcharts_extjs4' // For website | ||
'Chart' : '../Chart' | ||
} | ||
}); | ||
|
||
Ext.require('Chart.ux.Highcharts'); | ||
Ext.require('Chart.ux.Highcharts.Serie'); | ||
Ext.require('Chart.ux.Highcharts.AreaRangeSerie'); | ||
Ext.require('Chart.ux.Highcharts.AreaSerie'); | ||
Ext.require('Chart.ux.Highcharts.AreaSplineRangeSerie'); | ||
Ext.require('Chart.ux.Highcharts.AreaSplineSerie'); | ||
Ext.require('Chart.ux.Highcharts.BarSerie'); | ||
Ext.require('Chart.ux.Highcharts.BoxPlotSerie'); | ||
Ext.require('Chart.ux.Highcharts.BubbleSerie'); | ||
Ext.require('Chart.ux.Highcharts.ColumnRangeSerie'); | ||
Ext.require('Chart.ux.Highcharts.ColumnSerie'); | ||
Ext.require('Chart.ux.Highcharts.ErrorBarSerie'); | ||
Ext.require('Chart.ux.Highcharts.FunnelSerie'); | ||
Ext.require('Chart.ux.Highcharts.GaugeSerie'); | ||
Ext.require('Chart.ux.Highcharts.SolidGaugeSerie'); | ||
Ext.require('Chart.ux.Highcharts.LineSerie'); | ||
Ext.require('Chart.ux.Highcharts.PieSerie'); | ||
Ext.require('Chart.ux.Highcharts.RangeSerie'); | ||
Ext.require('Chart.ux.Highcharts.ScatterSerie'); | ||
Ext.require('Chart.ux.Highcharts.SplineSerie'); | ||
Ext.require('Chart.ux.Highcharts.WaterfallSerie'); | ||
Ext.require('Chart.ux.Highcharts.PyramidSerie'); | ||
|
||
// ALWAYS POST!! | ||
Ext.override(Ext.data.proxy.Ajax,{ | ||
getMethod: function(request) { | ||
return 'POST'; | ||
} | ||
}); | ||
|
||
Ext.ns("Demo"); | ||
|
||
Ext.application({ | ||
name : 'Highcharts', | ||
// appFolder : HOME + '/demos/Highcharts_ExtJs_4/app', // For website | ||
appFolder : 'app', | ||
controllers : ['Charts'], | ||
requires: [ | ||
'Highcharts.ChartsDesktopConfig' | ||
], | ||
launch : function() { | ||
|
||
// For joekuan.org website | ||
if (Ext.get('loading-mask')) | ||
Ext.get('loading-mask').fadeOut({remove:true}); | ||
|
||
var title = 'ExtJs version: ' + Ext.versions.core.version + ", " + | ||
'Highcharts version: ' + Highcharts.version + ", " + | ||
'Chart.ux.Highchart: ' + Chart.ux.Highcharts.version; | ||
|
||
Ext.create('Ext.container.Viewport', { | ||
layout : 'border', | ||
border : '5 5 5 5', | ||
title: title, | ||
listeners: { | ||
close: function(window) { | ||
$("#layerslider", parent.document.body).slideDown(400, function() { | ||
$('#demo', parent.document.body).html(''); | ||
}); | ||
} | ||
}, | ||
items : [{ | ||
region: 'north', | ||
title: title, | ||
border: true | ||
}, { | ||
region : 'west', | ||
width : 200, | ||
title : 'Charts', | ||
id: 'leftTree', | ||
xtype : 'chartsTree', | ||
margins : '0 0 5 5', | ||
split: true | ||
}, { | ||
region : 'center', | ||
id : 'centerpane', | ||
xtype : 'panel', | ||
layout : 'fit', | ||
margins : '0 5 5 0', | ||
tbar : [{ | ||
text : 'Reload Data', | ||
id : 'reload', | ||
disabled : true, | ||
action: 'reload' | ||
}, { | ||
text: 'Add Series', | ||
id: 'addSeries', | ||
disabled: true, | ||
action: 'addSeries' | ||
}] | ||
}] | ||
}).show(); | ||
|
||
} | ||
}); |
Oops, something went wrong.