How to add Icon to Dropdown and dropdown items
Hello, How can i add Icon to Dropdown widget and dropdown items #153
for dropdown nutton we can use icon as the official example :
widget.createDropdown(
{
title: 'dropdown',
tooltip: 'tooltip for this dropdown',
items: [
{
title: 'item#1',
onSelect: () => {console.log('1');},
},
{
title: 'item#2',
onSelect: () => {widget.setSymbol('IBM', '1D');},
},
{
title: 'item#3',
onSelect: () => {
widget.activeChart().createStudy(
'MACD',
false,
false,
{
in_0: 14,
in_1: 30,
in_3: 'close',
in_2: 9
}
);
},
}
],
icon: <svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"><g fill="none" stroke="currentColor"><circle cx="10" cy="10" r="2.5"/><circle cx="18" cy="18" r="2.5"/><path stroke-linecap="square" d="M17.5 7.5l-7 13"/></g></svg>,
}
).then(myDropdownApi => {
// Use myDropdownApi if you need to update the dropdown:
// myDropdownApi.applyOptions({
// title: 'a new title!'
// });
// Or remove the dropdown:
// myDropdownApi.remove();
});