Mi código actual:
const donutData = [
{
values: [2, 98],
labels: ['', ''],
sort: false,
marker: {
colors: ['#0099cc', '#535353'],
},
name: '',
hoverinfo: 'none',
textfont: {
size: [16, 1],
color: ['#ffffff', '#535353'],
fill: ['#ffffff', '#535353'],
},
hole: 0.7,
insidetextorientation: 'none',
type: 'pie',
textposition: 'none',
automargin: true,
},
];
const layout = {
paper_bgcolor: '#262626',
plot_bgcolor: '#262626',
autosize: true,
margin: { t: 100, b: 10, l: 0, r: 0 },
font: {
color: '#fff',
family: 'Roboto',
size: 18,
},
showlegend: false,
width: 500,
height: 500,
title: {
text: `donut`,
},
annotations: [
{
font: {
size: 60,
},
showarrow: false,
text: `30%`,
},
],
};
Quiero redux el espacio entre el título y el gráfico de anillos. Intenté agregar pad: 0 en el objeto de margen pero no funcionó. Además, no pude encontrar ningún atributo relacionado en el objeto de título. ¿Hay alguna propiedad que me ayude? añadió SS.
Puede controlar el espacio por la variable y como y=0.8 en el parámetro de title de la siguiente manera:
title: {
text: `donut`,
y: 0.8 # you can change this value as you prefer to reduce the space
},