Forum Discussion
Anonymous
8 years agoNot applicable
Datacolor changing only after reloading visual
I have created a pie chart and added Data Color property to it. But if i change the color of a data point,the change in color can be seen only after I reload the visual. Why is it not instantaneous...
- 8 years ago
Anonymous,
Change it as follows.
let arcs = this.pieChartContainer.selectAll('.arc') .data(this.pie(this.datapoints)) ; arcs.enter() .append('path') .attr('class', 'arc') ;
Anonymous
8 years agoNot applicable
this.arc = d3.svg.arc()
.innerRadius(0)
.outerRadius(radius);
console.log(radius);
this.pie = d3.layout.pie<Data>().value((d: Data):number => d.quantity).sort(null);
let fill = ((d):string=> d.data.color);
// let tf = (d: Data) => `translate(${this.arc.centroid(d)})`;
//let text = d => d.data.category;
let arcs=this.pieChartContainer.selectAll('.arc')
.data(this.pie(this.datapoints))
.enter()
.append('path')
.attr('class', 'arc')
;
arcs
.attr('d', this.arc)
.attr('fill',fill)
.attr('fill-opacity',1)
.attr("stroke-width","0.8")
; This is my current code. Still not working. The radius also changes only after visual reload.
v-chuncz-msft
8 years agoCommunity Support
Anonymous,
Change it as follows.
let arcs = this.pieChartContainer.selectAll('.arc')
.data(this.pie(this.datapoints))
;
arcs.enter()
.append('path')
.attr('class', 'arc')
;- Anonymous8 years agoNot applicable
Thanks v-chuncz-msft . This helped a lot. Could you please explain why it worked?