How to use the drilldown function of ui.highchart
?
#13
-
Questionfrom nicegui import ui
main_series = [
{"name": "M2", "y": 63.06, "drilldown": "M2"},
{"name": "M5", "y": 19.84, "drilldown": "M5"},
]
drilldown_series = [
{
"name": "M12",
"id": "M12",
"data": [
["test1", 3.39],
["test2", 0.96],
],
},
{
"name": "M0",
"id": "M0",
"data": [
["test1", 3.39],
["test2", 0.96],
],
},
{
"name": "M5",
"id": "M5",
"data": [
["test1", 3.39],
["test2", 0.96],
],
},
]
ui.highchart(
{
"chart": {"type": "column"},
"title": {"text": "Browser Market Share"},
"xAxis": {"type": "category"},
"legend": {"enabled": False},
"plotOptions": {
"series": {
"borderWidth": 0,
"dataLabels": {
"enabled": True,
"format": "{point.y:.1f}%",
},
}
},
"tooltip": {
"headerFormat": "<span style='font-size:11px'>{series.name}</span><br>",
"pointFormat": (
"<span style='color:{point.color}'>{point.name}</span>: "
"<b>{point.y:.2f}%</b> of total<br/>"
),
},
"series": [{"name": "Main", "colorByPoint": True, "data": main_series}],
"drilldown": {
"breadcrumbs": {"position": {"align": "right"}},
"series": drilldown_series,
},
}
)
ui.run() |
Beta Was this translation helpful? Give feedback.
Answered by
falkoschindler
Jan 21, 2025
Replies: 3 comments 1 reply
-
I used the above code to build drilldown functionality, but it didn't work |
Beta Was this translation helpful? Give feedback.
0 replies
-
The expected effect is shown in https://www.highcharts.com/demo/highcharts/column-drilldown |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @Carlelst, You need to specify the extra "drilldown": ui.highchart({...}, extras=['drilldown']) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Carlelst
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @Carlelst,
You need to specify the extra "drilldown":