javascript - ChartJS click on bar and change it's background color -


i'm using chartjs paint simple bar chart. bar chart clickable , notice if user clicks on bar. i'd change background of bar has been clicked indicate bar actively selected.

is possible?

thx

edit: i've added small example. https://jsfiddle.net/10n39clz/1/ clicked element collected using: this.getelementatevent(e)

if spend time playing console , element, see if log element, have array 1 object (the said element).

this object has several children, such _index (what used in fiddle).
should start editing element background.

if go deep inside _chart child, can edit bar want.

i updated fiddle see result : here is.


note that effect disappear if mouseleave out of element.


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -