Home > Software engineering >  Unset fill black
Unset fill black

Time:01-13

The Google Visualization Chart is filled with a color if the fill css property is set, e.g.

* {
  fill: black;
}

Is there a way to unset the CSS fill property so that it uses the original colors? The goal is not to modify the Chart component is any way, the fill is unrelated to the chart (can be used to change other SVGs) but it affects the chart.

This does not work:

#chart_div * {
  fill: unset;
}

See this fiddle: https://jsfiddle.net/g37fjyLx/1/

I realize that setting the fill for all elements * is probably not a good idea, but I'd still like to know if there is a way to reset it.

CodePudding user response:

you need to use backgroundColor.fill. Please refer this https://developers.google.com/chart/interactive/docs/gallery/ganttchart#configuration-options

var options = {
  height: 275,
  backgroundColor: { fill: "#333" } 
};

CodePudding user response:

use this for your color:

  var options = {
    height: 275,
    gantt: {
        criticalPathEnabled: false, // Critical path arrows will be the same as other arrows.
        arrow: {
          angle: 100,
          width: 5,
          color: 'blue',
          radius: 0
        }
      }
  };
  • Related