Q:

How to implement bar chart / pie chart in Android WITHOUT external libraries?

for my project I want to implement a bar chart which shows my costs.
I just want to make a simple bar chart but I am not allowed to use libraries like MP Android chart library. Instead I have to use onDraw from the View class.
I'm really struggling right now as I don't know how I should go on. Is there any tips or tutorial?
Maybe like this:

Is it possible without library and just with the onDraw?

A:

Yes, it is possible using only onDraw. Take a look at these examples of how to draw custom shapes: first, second. These examples are in Kotlin language, but the logic and API method names are the same.
You should use Canvas.drawRect method to draw rectangles and here is an example of how to draw a coloured, bordered, rectangle.

