Git Product home page Git Product logo

Comments (6)

NickQiZhu avatar NickQiZhu commented on May 5, 2024

I am currently working on a few more examples which will be ready with the
next release. At the mean time you can take a look at the play-ground.html
page under test folder. I have also attached a simplified example package
with a single pie chart using the same test data used in play-ground.html.
Have fun :)

Nick

On Tue, Aug 7, 2012 at 10:00 PM, jschoch [email protected] wrote:

i'm having a hard time getting your example to work, any chance you can
whip up a simplified but fully working example with a single chart and put
it in an /examples directory from your source? I've tried to grab the
example from the github page and grabbed the data via wget ndx.csv but it
will not render. Also it is very unclear if renderAll() fails as it does
for me, how do you render a single chart? gainOrLossChart.render() and
gainOrLossChart.doRender() don't seem to do anything but return a chart
object. I have no svg anywhere in my source before or after trying to
.render() or dc.renderAll()

As a side note your example shows data.csv which does not exist on github,
so if you want to see what the data looks like it can be confusing as to
where to find the csv file.

BTW the error I'm seeing is: Uncaught TypeError: Cannot set property '*
group_index*' of null dc.js:1554


Reply to this email directly or view it on GitHubhttps://github.com//issues/17.

from dc.js.

jschoch avatar jschoch commented on May 5, 2024

I don't see an attachment in the issue, is it somewhere else?

from dc.js.

NickQiZhu avatar NickQiZhu commented on May 5, 2024

Huh, forgot it was a reply to github notification. Try replace the body of test/play-ground.html with the following example:

<div id="pie-chart-value" class="chart">
    <span>Value DonutChart</span>
    <a class="reset" href="javascript:pieChartValue.filterAll();dc.redrawAll();" style="display: none;">reset</a>
    <br/><span class="reset" style="display: none;">Current filter: <span class="filter"></span></span>
    <div class="clear"></div>
</div>

<script type="text/javascript">
    var pieChartValue = dc.pieChart("#pie-chart-value")
            .width(250)
            .height(250)
            .radius(100)
            .innerRadius(40)
            .dimension(valueDimension)
            .group(valueGroup)
            .title(function(d) {
                return d.data.key + ": " + d.data.value;
            })
            .renderTitle(true);

    dc.renderAll();
</script>

<div class="clear"></div>

<div>
    <a href="javascript:dc.renderAll();">Render All</a>
    <a href="javascript:dc.filterAll(); dc.renderAll();">Filter All</a>
</div>

from dc.js.

aggaton avatar aggaton commented on May 5, 2024

As a side remark, I got this to work locally by grabbing source and data with wget, created a virtual dir and ran it through localhost. For some reason I cannot get it to work by just opening index.html in the browser, it has to run through an actual web server.

from dc.js.

matthull avatar matthull commented on May 5, 2024

@aggaton This one-liner fires up a web server effortlessly (run in web folder of dc.js project)

ruby -run -ehttpd . -p8000

Should work for anyone with ruby installed.

@jrideout Maybe this should be noted in a 'running the examples' wiki page?

from dc.js.

jrideout avatar jrideout commented on May 5, 2024

@aggaton That is because the browser won't allow an ajax request to a local file as a security precaution.

@matthull good idea.

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.