Android Shinobi Background color


Hi All,

I am wondering if there is a function to change the background color of Shinobi graph. As seen below, the shinobi graph is gray color, and the backround is white color. Is the background of white color changeable to gray ?




Hi Victor,

There certainly is such a function! You can change three different background colours on the chart by getting the ChartStyle object from the ShinobiChart (using the getStyle() method), calling the relevant method and finally calling redrawChart() on the ShinobiChart.

The three background colours are as follows:

  • setPlotAreaBackgroundColor(int) - this is the area where the series are drawn, in your picture above it’s the grey area
  • setCanvasBackgroundColor(int) - this is the area taken up by the plot area plus the axes
  • setBackgroundColor(int) - this is the area taken up by the canvas area plus the chart’s title and the legend if it is shown and is outside the plot area

Note that the plot area sits on top of the canvas, which in turn sits on top of the chart.

Hope that helps!