如何在Ext.js中使用d3.js图形? [英] How to use d3.js graphs in Ext.js?

查看:202
本文介绍了如何在Ext.js中使用d3.js图形?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以指点我,甚至最简单的例子如何嵌入d3.js图形到ext.js?我做了很多搜索:我甚至不确定这是可能的。还是吗?提前感谢。

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.

推荐答案

到目前为止,我使用的结果过于简单:

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.....

}

});

这篇关于如何在Ext.js中使用d3.js图形?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆