https://grafana.com/tutorials/build-a-panel-plugin/
I got a problem following, It seems that it doesn't work with const theme = useTheme2():
''let color: string;
switch (options.color) {
case 'red':
color = theme.palette.redBase;
break;
case 'green':
color = theme.palette.greenBase;
break;
case 'blue':
color = theme.palette.blue95;
break;
}''
So I am using the following code for replacement and It goes OK. But I am not sure it is right.
'' let color: string;
switch (options.color) {
case 'red':
color = "red";
break;
case 'green':
color = "green";
break;
case 'blue':
color = "blue";
break;
}''
https://grafana.com/tutorials/build-a-panel-plugin/ I got a problem following, It seems that it doesn't work with const theme = useTheme2(): ''let color: string; switch (options.color) { case 'red': color = theme.palette.redBase; break; case 'green': color = theme.palette.greenBase; break; case 'blue': color = theme.palette.blue95; break; }''
So I am using the following code for replacement and It goes OK. But I am not sure it is right. '' let color: string; switch (options.color) { case 'red': color = "red"; break; case 'green': color = "green"; break; case 'blue': color = "blue"; break; }''