3

I've attached a screenshot. As per the screenshot I want to make the horizontal bar chart graph to my activity same as the snapshot. I've done half of it's contents using MP Chart Library. I can't add the x axis values starting from 3 to 9. Also not unable to add the vertical grids.

enter image description here

Please suggest me what I should do?

In advance thanks for your help and your little help will be appreciated.

Parth Bhayani
  • 1,894
  • 3
  • 17
  • 35

2 Answers2

2

Use GraphView http://www.android-graphview.org/ I hope it would be helpful.

1

Create a xml file for a gradient in the /drawable folder and apply it to a LinearLayout as the background. The angle has to be 0.

<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <gradient
        android:startColor="#000000"
        android:endColor="#ff3399"
        android:angle="0"/>
</shape>


<LinearLayout 
    android:id="@+id/bar_1" 
    android:layout_width="wrap_content" 
    android:background="@drawable/my_gradient"> 
</LinearLayout>

Regarding the background: Try the GridLayout which enables to 'aggregate' cells. But this might be tricky.

Kody
  • 1,154
  • 3
  • 14
  • 31
  • I'll try to do this but my main focus on the graph in which I can't add the values which is shown into the image. – Parth Bhayani Jan 08 '15 at 10:20
  • If you're ok with a out-of-the-box solution --> https://code.google.com/p/achartengine/ :) – Kody Jan 08 '15 at 10:26