lafriks / vue-bar-graph

Simple and lightweight vue chart component without using chart library dependencies
5 stars 3 forks source link

Set bar color #2

Closed nikzanda closed 3 years ago

nikzanda commented 3 years ago

It would be nice to be able to set color bars.

For this purpose, I'm using JavaScript like this:

let rects = document.getElementsByTagName("rect");
rects.forEach((rect) => {
    rect.style.fill = "#ffff00";
});

In this way it works! But it would be nicer to be able to pass a color array to the component.

lafriks commented 3 years ago

Fixed in 1.3.0, see sample: https://github.com/lafriks/vue-bar-graph/blob/master/src/App.vue#L175