Search code examples
javaandroidgraphic

Android Java how to make single bar graphic


I need to show a "graphic" with part of the box colored in. In the box it it will have text, but then I want to be able to put a color on the background to show how high the numbers are. see the graphic I made in excel. (I guess I am not allowed to upload a picture. So not sure how to explain this..
Click here to see the excel picture

Anyone know how to do this?


Solution

  • Do you want the colour to dynamically change colour for each value? Or are you okay with just having a few colour "levels" (e.g. red, yellow, green).

    The easier route would be to just have a few set colours and create those gradients in photoshop and then apply those textures to the back of an ImageView using the background attribute.

    Here are some tutorials on how views work: http://developer.android.com/resources/tutorials/views/index.html