Can you help me define palette values for different charts?

var myTheme = {

  "palette" : { // object
    "hbar" : [ // Key is chart type name, value is array of arrays
      ["#ffffff", "#40beeb", "#40beeb", "#40beeb"], // array of colors for plot 0
      ["#ffffff", "#305f74", "#305f74", "#305f74"], // array of colors for plot 1
      ["#ffffff", "#4492a8", "#4492a8", "#4492a8"], // array of colors for plot 2
      ["#ffffff", "#8e8e8e", "#8e8e8e", "#8e8e8e"], // etc...
      ["#ffffff", "#85bdcd", "#85bdcd", "#85bdcd"]
    ],
    "vbar" : [
      ["#ffffff", "#40beeb", "#40beeb", "#40beeb"],
      ["#ffffff", "#305f74", "#305f74", "#305f74"],
      ["#ffffff", "#4492a8", "#4492a8", "#4492a8"],
      ["#ffffff", "#8e8e8e", "#8e8e8e", "#8e8e8e"],
      ["#ffffff", "#85bdcd", "#85bdcd", "#85bdcd"]
    ]
  }
}; 

Then in your render method, specify that you'd like to use your theme object like so:

zingchart.render({ 
  id : 'myChart',  
  data : myJson, 
  height: 400, 
  width: 600,
  defaults:myTheme
});

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.