PDA

View Full Version : Force to draw charts in VML



litbit
14 Nov 2012, 12:00 AM
Anyone knows? We need to draw charts and other stuff in VML, not in SVG.

Thank you.

vietits
14 Nov 2012, 2:21 AM
Try this:


Ext.define('Override.draw.Surface', {
override: 'Ext.draw.Surface',
statics: {
create: function(config, engine){
this.callParent([config, engine || ['Vml']]);
}
}
});

litbit
14 Nov 2012, 4:40 AM
Component.js

setSurfaceSize: function (width, height) {
this.surface.setSize(width, height);


Uncaught TypeError: Cannot call method 'setSize' of undefined Component.js:306 (http://localhost/JuiceDashboard/Content/Scripts/Ext4/src/draw/Component.js?_dc=1352896787626)

Ext.define.setSurfaceSizeComponent.js:306 (http://localhost/JuiceDashboard/Content/Scripts/Ext4/src/draw/Component.js?_dc=1352896787626)
Ext.define.finishedLayoutDraw.js:87 (http://localhost/JuiceDashboard/Content/Scripts/Ext4/src/layout/component/Draw.js?_dc=1352896787676)
Ext.define.callLayoutContext.js:349 (http://localhost/JuiceDashboard/Content/Scripts/Ext4/src/layout/Context.js?_dc=1352896787621)
Ext.define.flushLayoutsContext.js:520 (http://localhost/JuiceDashboard/Content/Scripts/Ext4/src/layout/Context.js?_dc=1352896787621)
Ext.define.runCompleteContext.js:1093 (http://localhost/JuiceDashboard/Content/Scripts/Ext4/src/layout/Context.js?_dc=1352896787621)
dext.js:27 (http://localhost/JuiceDashboard/Content/Scripts/Ext4/ext.js)
b.implement.callParentext.js:27 (http://localhost/JuiceDashboard/Content/Scripts/Ext4/ext.js)
Ext.override.runCompleteAbstractComponent.js:80 (http://localhost/JuiceDashboard/Content/Scripts/Ext4/src/AbstractComponent.js?_dc=1352896787452)
Ext.define.runContext.js:1077 (http://localhost/JuiceDashboard/Content/Scripts/Ext4/src/layout/Context.js?_dc=1352896787621)
Ext.define.statics.flushLayoutsAbstractComponent.js:84 (http://localhost/JuiceDashboard/Content/Scripts/Ext4/src/AbstractComponent.js?_dc=1352896787452)
Ext.define.statics.updateLayoutAbstractComponent.js:144 (http://localhost/JuiceDashboard/Content/Scripts/Ext4/src/AbstractComponent.js?_dc=1352896787452)
Ext.define.updateLayoutAbstractComponent.js:2853 (http://localhost/JuiceDashboard/Content/Scripts/Ext4/src/AbstractComponent.js?_dc=1352896787452)
Ext.define.onContentChangeLayout.js:463 (http://localhost/JuiceDashboard/Content/Scripts/Ext4/src/layout/Layout.js?_dc=1352896787489)
Ext.define.doCollapseExpandPanel.js:1515 (http://localhost/JuiceDashboard/Content/Scripts/Ext4/src/panel/Panel.js?_dc=1352896787433)
Ext.define.collapsePanel.js:1498 (http://localhost/JuiceDashboard/Content/Scripts/Ext4/src/panel/Panel.js?_dc=1352896787433)
Ext.define.statics.InitializeContentArea.js:9 (http://localhost/JuiceDashboard/Content/Scripts/Application/ContentArea.js)
Ext.define.statics.StepsApplication.js:42 (http://localhost/JuiceDashboard/Content/Scripts/Application.js)
Ext.define.statics.RunNextStepApplication.js:104 (http://localhost/JuiceDashboard/Content/Scripts/Application.js)
(anonymous function)Application.js:105 (http://localhost/JuiceDashboard/Content/Scripts/Application.js)
(anonymous function)Filters.js:197 (http://localhost/JuiceDashboard/Content/Scripts/Application/Filters.js)
Ext.Ajax.request.successCore.js:30 (http://localhost/JuiceDashboard/Content/Scripts/Application/Core.js)
Ext.apply.callbackext.js:27 (http://localhost/JuiceDashboard/Content/Scripts/Ext4/ext.js)
Ext.define.onCompleteConnection.js:872 (http://localhost/JuiceDashboard/Content/Scripts/Ext4/src/data/Connection.js?_dc=1352896787747)
Ext.define.onStateChangeConnection.js:820 (http://localhost/JuiceDashboard/Content/Scripts/Ext4/src/data/Connection.js?_dc=1352896787747)
(anonymous function)

vietits
14 Nov 2012, 3:41 PM
Sorry, I forgot to return the result of creating draw engine. Try to fix the code as below:


Ext.define('Override.draw.Surface', {
override: 'Ext.draw.Surface',
statics: {
create: function(config, engine){
return this.callParent([config, engine || ['Svg']]);
}
}
});

litbit
16 Nov 2012, 12:07 AM
When using this method:
Uncaught TypeError: Cannot call method 'setSize' of undefined Component.js:306 (http://localhost/JuiceDashboard/Content/Scripts/Ext4/src/draw/Component.js?_dc=1353053222445)



Uncaught TypeError: Cannot read property 'length' of undefined Dock.js:228 (http://localhost/JuiceDashboard/Content/Scripts/Ext4/src/layout/component/Dock.js?_dc=1353053222123)