Reputation: 43
Hi I am making a graph chart using text view. I am getting graph data from a api. I need to set the textview height which makes the graph bars. I have set the parent view height 200 . I am confused as how to always set textview height less than 200. Graph value can be 15 or sometimes it can be 180 or 400 . In case of 15 also it should fill the parent and in case of 300 also it should fill the parent. But adjust all the graph bars according to the parent view height .
Upvotes: 0
Views: 140
Reputation: 1621
IF you want to keep parent height constant @200 then you need to change the y axis accordingly like y axis points will be if some value is 15 and it is max then y axis point will be 20 max so that it will show, if max value is 180 then y axis points will change to 200 max, if max value is 400 then y axis points will be 500 max. like this you have to manage all by keeping parent height constant.
Upvotes: 1