how to display graph in android using MySQL database

后端 未结 2 1489
再見小時候
再見小時候 2021-01-07 15:04

I can\'t get data from MySQL database for graphics. I found an example code for create graph but I want to put x axis data and y axis data from database

My example c

相关标签:
2条回答
  • 2021-01-07 15:20

    Yeah, this just isn't going to work. Activity.onCreate is not main(). You can't just put your application there.

    I'm sure this isn't what you want to hear, by you really need to go all the way back to the drawing board. You are going to want to put the code that requests the JSON object into a Service.

    The code that does the actual graphing looks pretty good. You will need to set it up so that when the Service succeeds in retrieving the JSON, and then parsing it, it notifies the Activity that there is something to graph.

    Step back from the code and brush up on Android architecture for a couple days. It isn't hard, but it is different.

    0 讨论(0)
  • 2021-01-07 15:22

    Yes.It will be possible. you can follow my example

    Bar Chart in Android With out any Built in jars. Here you can get data from database and try to set the results in the arrays(Say grossSal,netSal,datelabel arrays)

    Here is the simple logic with no jars needed. you can implement bar charts with your own coding from this example

    0 讨论(0)
提交回复
热议问题