Hi,

This is Sumit Chopra, Senior Developer from 3clogic.
We are exploring sunburst charts. During this I am encountering a problem
with showing legends.

Our requirement is to show the legends so that we can show and hide certain
sections of our chart using the legends. Please let me know if we can show
legends on sunburst charts.

It will be very helpful if you can send me a demo config for legends.

Below I have attached the config that I am using. I need the legends for
all the 7 items in the first circle.


-- 
*Best Regards,*
*Sumit Chopra*
*Principal Engineer*
*3CLogic Noida*
*Contact: +91**9582582392*
var data = [
  {
    name: 'Active',
    itemStyle: {
      color:'#41c1c2',
    },
    label: {
      fontSize: '10'
    },
    children: [
      {
        name: 'Active (1)',
        value: 1,
        itemStyle: {
          color:'#68E3E3'
        },
        label: {
          fontSize: '10'
        }
      }
    ]
  },
  {
    name: 'Available',
    itemStyle: {
      color:'#70c58e'
    },
    label: {
      fontSize: '10'
    },
    label: {
      fontSize: '10'
    },
    children: [
      {
        name: 'Available (1)',
        value: 1,
        itemStyle: {
          color:'#68E393'
        }
      }
    ]
  },
  {
    name: 'Away',
    itemStyle: {
      color:'#fdbe11'
    },
    label: {
      fontSize: '10'
    },
    children: [
      {
        name: 'Away (1)',
        value: 1,
        itemStyle: {
          color:'#E3C268'
        }
      }
    ]
  },
  {
    name: 'Busy',
    itemStyle: {
      color:'#f26261'
    },
    label: {
      fontSize: '10'
    },
    children: [
      {
        name: 'Out for the coffee (10)',
        value: 1,
        itemStyle: {
          color:'#FF8F8F'
        },
        label: {
          fontSize: '10'
        }
      },
      {
        name: 'Out for the lunch (11)',
        value: 1,
        itemStyle: {
          color:'#FF8F8F'
        },
        label: {
          fontSize: '10'
        }
      }
    ]
  },
  {
    name: 'Wrapup',
    itemStyle: {
      color:'#475868'
    },
    label: {
      fontSize: '10'
    },
    children: [
      {
        name: 'Wrapup (1)',
        value: 1,
        itemStyle: {
          color:'#68A8E3'
        },
        label: {
          fontSize: '10'
        }
      }
    ]
  },
  {
    name: 'Preview',
    itemStyle: {
      color:'#3ec7f3'
    },
    label: {
      fontSize: '10'
    },
    children: [
      {
        name: 'Preview (1)',
        value: 1,
        itemStyle: {
          color:'#68C4E3'
        },
        label: {
          fontSize: '10'
        }
      }
    ]
  },
   {
    name: 'Off',
    itemStyle: {
      color:'#bfb8b9'
    },
    label: {
      fontSize: '10'
    },
    children: [
      {
        name: 'Off (1)',
        value: 1,
        itemStyle: {
          color:'#ddd'
        },
        label: {
          fontSize: '10'
        }
      }
    ]
  }
];
option = {
  legend:{
    data:[{
      name:'Busy'
    }]
  },
  "tooltip": {
      "show":true,
      "formatter": "{c}"
    },
  title: {
    text: '23',
    subtext: 'Agents',
    textStyle: {
      fontSize: 11
    },
    subtextStyle: {
      fontSize: 11,
      align: 'center',
      fontWeight: 900
    },
    top: '45%',
    left: 'center'
  },
  series: [
    {
      "avoidLabelOverlap": true,
      type: 'sunburst',
      data: data,
      sort: undefined,
      emphasis: {
        focus: 'ancestor'
      },
      levels: [
        {},
        {
          r0: '20%',
          r: '45%',
          itemStyle: {
            borderWidth: 2
          },
          label: {
            rotate: 'radial',
            align: 'center',
          }
        },
        {
          r0: '45%',
          r: '90%',
          label: {
            align: 'center',
            overflow: 'break',
            width: 80,
            rotate: 'radial'
          }
        }
      ]
    }
  ]
};
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@echarts.apache.org
For additional commands, e-mail: dev-h...@echarts.apache.org

Reply via email to