chinmaymk / angular-charts

angular directives for creating common charts using d3
MIT License
1.03k stars 270 forks source link

Angular-charts incompatible with datejs #136

Open kmikzjh opened 10 years ago

kmikzjh commented 10 years ago

A few days ago, I implemented a pie chart with angular-charts, then I added datejs for a report and the chart stopped working (svg without values -path tag-), but when I removed datejs, the chart worked again.

Without datejs

<svg width="300" height="176">
    <g transform="translate(150,88)">
        <g>
            <path class="arc" d="M0,-78A78,78 0 0,1 0,-78L0,0Z" style="fill: rgb(255, 133, 27);"></path>
        </g>
        <g>
            <path class="arc" d="M0,-78A78,78 0 0,1 0,-78L0,0Z" style="fill: rgb(40, 182, 44);"></path>
        </g>
        <g>
            <path class="arc" d="M0,78A78,78 0 1,1 0,-78A78,78 0 1,1 0,78Z" style="fill: rgb(117, 202, 235);"></path>
        </g>
    </g>
</svg>

With datejs

<svg width="300" height="176">
    <g transform="translate(150,88)">
        <g>
            <path style="fill: rgb(255, 133, 27);"></path>
        </g>
        <g>
            <path style="fill: rgb(40, 182, 44);"></path>
        </g>
        <g>
            <path style="fill: rgb(117, 202, 235);"></path>
        </g>
    </g>
</svg>

Any idea??

chaosfinity commented 10 years ago

I tested with the examples page and the issue did not occur. Are you using the latest version of angular-charts?

angularchartsdatejs

chinmaymk commented 10 years ago

This would be an issue in preparing your data. Try logging it before passing to angular-charts

JerabekJakub commented 9 years ago

I have the same issue. I have latest version of angular-charts. When I remove datejs.js it works. Look at your basic example with added (not used) datejs.js import: http://plnkr.co/edit/QFlB1DsWxwwgiboiNjSR?p=preview

chaosfinity commented 9 years ago

This is a conflict with datejs and d3. There is a issue over on the d3 project https://github.com/mbostock/d3/issues/1302 with a link to a trunk version of datejs that does not replace Date.now()