bmarrdev / android-DecoView-charting

DecoView: Android arc based animated charting library
Apache License 2.0
991 stars 194 forks source link

Set strict size when total angle is 180degrees #21

Open guyzk opened 8 years ago

guyzk commented 8 years ago

Is it possible to set a specific height/width to the arc. I am looking for a semi circle pie (180degrees) but when setting the height to a specific value the arc height takes only 50% of the view height. Is there an option to set the width/height of the canvas that will contain the pie? If not at least will it be possible to clip the un-needed excess empty area from the view?

capture

Also is it possible to add range labels as in the next image?

capture1

bmarrdev commented 8 years ago

The DecoView will always render allowing space for the arc to take up 360 degrees. When I originally developed this I implemented an auto crop and fill feature that would do what you require, but it was pulled before the initial release.

The quickest way for you to get this functionality is to fork the DecoView project and hardcode the chart to render as you prefer. With the canvas area you can look at the DecoView::recalcLayout(), which handles the positioning of the chart within the total canvas area. With the placing of the labels, you can do these as external TextViews or you can hack your placement requirements into the DecoView::onDraw() function where CanvasView::drawLabel() renders the text.