How to use d3.js graphs in Ext.js?

℡╲_俬逩灬. 提交于 2019-12-24 16:57:47

问题


Can anyone point me to even the simplest example of how to embed d3.js graphics into ext.js? I've done a lot of searching: I'm not even sure it's possible. Or is it? Thanks in advance.


回答1:


An overly simplified version of what I have used with OK results so far:

Ext.define('desktop.controls.d3svg', {
extend: 'Ext.container.Container',
alias: 'widget.d3svg',

listeners: {

    added: function() {

        this.onAdded();

    }

},

onAdded: function() {

    // ext container has the outer and inner containers
    // use id for selection of inner container for appending svg
    var svg = d3.select('#' + this.id + '-innerCt').append("svg");

    this.svg = svg;

},

onResize: function(width, height) {

    // on the way to an example of using ext resize event and width
    // and height vars
    // this.svg.do_d3_resize_things.....

}

});


来源:https://stackoverflow.com/questions/14948593/how-to-use-d3-js-graphs-in-ext-js

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!