0

I am using ECharts to create a Doughnut chart and I would like to display static text in the center of the chart. However, there is a space between the text and subtext that I am unable to reduce. Can somebody please assist me in resolving this issue? The code is provided below with screenshot.

https://echarts.apache.org/examples/en/editor.html?c=pie-doughnut

option = {
    title: {
       text: `51`,
       subtext: 'INSTANCES',
       x: 'center',
       y: 'center',
       textStyle:{
         color: '#111111',
         fontFamily: 'Montserrat',
         fontWeight: 'bolder',
         fontSize: 70,
       },
       subtextStyle:{
          fontSize: 16,
         color: '#888888',
    }
    },
  tooltip: {
    trigger: 'item'
  },
  legend: {
    top: '5%',
    left: 'center'
  },
  series: [
    {
      name: 'Access From',
      type: 'pie',
      radius: ['55%', '70%'],
      avoidLabelOverlap: false,
      label: {
        show: false,
        position: 'center'
      },

      labelLine: {
        show: false
      },
      data: [
        { value: 36, name: 'Standard' },
        { value: 12, name: 'High Memory' },
        { value: 3, name: 'High CPU' },
        { value: 3, name: 'Other' },
      ]
    }
  ]
};
user2057925
  • 2,377
  • 1
  • 12
  • 12

2 Answers2

0

You can use the itemGap option.

https://echarts.apache.org/en/option.html#title.itemGap

Graphmaxer
  • 1
  • 1
  • 1
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 21 '23 at 14:03
0

itemGap could also be negative. Here is the result with itemGap:-33
itemgap:33

ned
  • 383
  • 2
  • 9