Help with Javascript and CSS graph?
Go to solution
Solved by Mr_KoKa,
No, fillColor is used originally to create new bar, but we modified so it's uses values from data so your code that initializes your chard should look like this:
var barChartData = { labels : ["Integritas","Optimus","Spirare","Virtus"], datasets : [ { fillColor : "rgba(220,0,0,1)", strokeColor : "rgba(0,0,0,0.8)", highlightFill: "rgba(200,200,0,0.75)", highlightStroke: "rgba(0,0,0,1)", data : [{value: 1, color: '#999'}, {value: 2, color: '#444'}] } ] }
I just noticed I ate one '{' and one apostrophe. sorry, it might be the problem.
You may want to fiddle with this lines in the second part:
highlightFill : dataset.highlightFill || dataset.fillColor, highlightStroke : dataset.highlightStroke || dataset.strokeColor
so you can control color of the bar after it's beeing highlighted, I'm not sure when it happens, but probably on mouse hover or click.

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now