Coder Social home page Coder Social logo

Comments (2)

NickQiZhu avatar NickQiZhu commented on May 3, 2024

Hi Christophe,

Thanks for the suggestion. If you are trying to draw the chart on an
already selected node through d3 then you can use the root() to manually
set the root after creating the chart, or if you are trying to overlay a
chart on an existing chart (which is what I think you are doing with the
code example) then you can use the compositeChart to achieve that.

Cheers,

Nick

On Thu, Aug 2, 2012 at 3:44 PM, christophe geiser <
[email protected]

wrote:

Hi,
Thanks for ver 0.6.0, good work.

Just one thing to mention here (just before I go on holiday - not much
time to submit propose a push) : I would suggest that _chart.anchor accept
a dom arguments so that you can call the creation of a chart on a node that
has already been selected.

_chart.anchor = function(a) {
        if (!arguments.length) return _anchor;
        if (a instanceof Object) {
            _anchor = a.anchor();
            _root = a.root();
        } else {
            _anchor = a;
            _root = d3.select(_anchor);
            dc.registerChart(_chart);
        }
        return _chart;
    };

This might do it (but there are certainly other ways) - not tested:

_chart.anchor = function(a) {
        if (!arguments.length) return _anchor;
        if (typeof a.anchor === 'function') {
            _anchor = a.anchor();
            _root = a.root();
        } else {
            _anchor = a;
            _root = d3.select(_anchor);
            dc.registerChart(_chart);
        }
        return _chart;
    };

Cheers,
C.


Reply to this email directly or view it on GitHub:
#11

from dc.js.

gordonwoodhull avatar gordonwoodhull commented on May 3, 2024

note this was eventually accepted as #264

from dc.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.