python-highcharts icon indicating copy to clipboard operation
python-highcharts copied to clipboard

how to drilldown a pie chart

Open Fanduzi opened this issue 5 years ago • 0 comments

hihgchatrs support drilldown https://www.highcharts.com/demo/pie-drilldown

Does charts support drilldown? I tried it and it didn't work

import charts
series = [{
    'type': 'pie',
    'name': 'Things',
    'colorByPoint': True,
    'data': [{
        'name': 'Animals',
        'y': 5,
        'drilldown': 'animals'
    }, {
        'name': 'Fruits',
        'y': 2,
        'drilldown': 'fruits'
    }, {
        'name': 'Cars',
        'y': 4,
        'drilldown': 'cars'
    }]
}]

drilldown = {
    'series': [{
        'id': 'animals',
        'data': [
            ['Cats', 4],
            ['Dogs', 2],
            ['Cows', 1],
            ['Sheep', 2],
            ['Pigs', 1]
        ]
    }, {
        'id': 'fruits',
        'data': [
            ['Apples', 4],
            ['Oranges', 2]
        ]
    }, {
        'id': 'cars',
        'data': [
            ['Toyota', 4],
            ['Opel', 2],
            ['Volkswagen', 2]
        ]
    }]
}
    

charts.plot(series, options={'title': {'text': 'A pie chart'}}, show='inline')

Fanduzi avatar Apr 14 '20 03:04 Fanduzi