on 2014 Oct 14 12:36 PM
Hello Experts,
I'm working on pie chart and able to get the result without any issues.
I have a below issue, please help me to resolve this.
1. When I mouse over on pie chart it displays relevant count.
Will it be possible to display count inside pie chart on initial load?
If so, could you please let me know how to do the same?
Thanks.
Request clarification before answering.
check this out, http://jsbin.com/zesav/1/edit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your quick reply.
When I use the same code in project I'm getting below error
1. Error: Invalid value for <text> attribute transform="translate(NaN,NaN)"
2. Uncaught TypeError: Cannot read property 'Count' of undefined
but the same code is working here
Do I need to add any script file?
Resolved this error.
In project, I have Stack bar chart and pie chart.
d3.selectAll(".v-datashape"); This code returns all datashape.
when I loop json with all datashape it throws "count undefined error"
So, modified the code like this,
var arcs = d3.select("#__pie1").selectAll(".v-datashape");
it works fine now.
Hi Sai,
Thank you for your reply!
In the sample code provided by Sakthivel above, we can select any element in the svg and change its property in initialize phase, see below:
Could you please let me know if we can achieve this in VizFrame? Thanks a lot!
----------------------------------------------------------------
pie.attachInitialized(this, function() {
var arcs = d3.selectAll(".v-datashape");
debugger;
var radius = 400 / 2 ; // Height --> 400px
var arc = d3.svg.arc().outerRadius(radius);
arcs.append("svg:text").attr("transform", function(d){
d.innerRadius = 0;
d.outerRadius = 200;
return "translate(" + arc.centroid(d) + ")";}).attr("text-anchor", "middle").text(function(d,i){
return oBusinessData[i].revenue;
});
});
Best Regards,
Madeleine
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.