ACE-IoT-Solutions / ace-svg-react

Grafana SVG Rendering Panel using the 7+ Plugin Framework
https://grafana.com/grafana/plugins/aceiot-svg-panel/
MIT License
41 stars 14 forks source link

Set Color #11

Closed smartcuc closed 3 years ago

smartcuc commented 3 years ago

Hi ACE-IoT-Solutions, Looks like a pretty good plugin, but due to not up to speed, I'm having some issue. However, I thought when using

if(lastValue_Tank == 1){
    svgmap.Tank.attr({ fill: '#CC00CC'});
};

the color would change. Unfortunately, this is not the case. Are you having some example handy to guide how to change color, level color, or staring rotations? Many thanks and best regards, Ruediger

acedrew commented 3 years ago

https://svgjs.com/docs/3.0/ Is going to be the best place for you to start in understanding what's possible. One thing that's easy to get caught on is that what you think was the element you clicked, and what you actually clicked might be different, for instance, if you clicked an element that didn't have an ID but the group it was in did, then you're not going to get a mapping element, and applying a fill to a group doesn't mean anything.