简体   繁体   中英

How to remove CSS fill property

I'm using JavaScript Apexcharts and it lays out bars with different colors, the problem is that I have a CSS property that overrides the fill with one single color, so now all bars have one color:

I can't access the file due to administration access but i want remove that fill property, is there a way to override or even remove it from the style

在此处输入图片说明

When i uncheck the fill property:

在此处输入图片说明

I basically want the second image, but I can't access that css stylesheet, is there a way to do it with either jQuery or JavaScript?

I tried the following but none of them work.

$('.accordion svg').style.removeProperty('fill');
$('.accordion svg').css('fill','');
$('.accordion svg').removeAttr("style");
$('.accordion svg').removeAttribute('fill');

You can avoid using CSS here by setting the colors property on the chartOptions / options object.

Example:

getChartOptions() {
    return {
        chart: {
            type: "bar",
        },
        series: [...],
        colors: ["#123456", "#234567", ...],
        ...
    }
}
        

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM