Hello,
I’m very new to plotly which is great btw! I have been playing with the Sunburst chart.
Apologies if this is a repost but I can’t find a similar topic in the forums.
I seem to be having issues with the text alignments.
When I set “insidetextorientation”: ‘horizontal’
- Some texts are not in the center but rather in the top
When I set “insidetextorientation”: ‘radial’
- I notice that the most left left will be horizontal and not follow the rest (radial)
Also, I would like to keep my font color uniform but I can’t seem to figure out how to modify the texts inside the sunburst chart.
Language: Javascript
Code Snippet:
<script>
Plotly.d3.csv("./dom.csv", function(err, rows){
function unpack(rows, key) {
return rows.map(function(row) {return row[key]})
}
var data = [
{
"type": "sunburst",
"maxdepth": 2,
//"ids": unpack(rows, 'ids'),
"labels": unpack(rows, 'labels'),
"parents": unpack(rows, 'parents'),
"values": unpack(rows, 'values'),
//"leaf": {"opacity": 0.4},
//"marker": {"line": {"width": 2}},
"branchvalues": 'total',
//"textposition": 'inside',
"insidetextorientation": 'radial' //tried changing to horizontal but some text aren't centered
}]
var layout = {
margin: {l: 0, r: 0, b: 0, t:0}
}
Plotly.newPlot('myDiv', data, layout, {displaylogo: false})
});
</script>
Thanks,
Dom