Separation of percentage values on the pie chart and rollover text


#1

Hi,

I am using pie graph. I want text to be displayed in rollover as part 1, part 2 and part 3 etc.
Implementing hoverinfo:“text” I am able to see desired text in rollover but same text is coming on the pie chart with percentage values.

Is it possible to display only percentage number on the pie chart and keep text in rollover?

var txt = [‘part 1’,‘part 2’,‘part 3’];
var data = [{
values: [19, 26, 55],
text: txt,
hoverinfo:“text”,
labels: [‘Residential’, ‘Non-Residential’, ‘Utility’],
type: ‘pie’
}];

Plotly.newPlot(‘myDiv’, data, {}, {showSendToCloud:true});

image


#2

Sounds like you’re looking for


#3

That’s correct!
I want to display percentage (e.g. 55%) on pie chart and text in hoverInfo tooltip (i.e. part 3)
Is it possible?


#4

Thanks a lot etienne!
I can set percent as a textinfo as mentioned on page https://plot.ly/javascript/reference/#pie-hovertext