Skip to content
Advertisement

get xAxis mpchart android from database with retrofit

I want to get xAxis from database which is result of distinct query so my chart can display data dynamically.

for static mpchart i have no problem with that. I called this function in onCreate.

JavaScript

this line which i to make dynamic.

JavaScript

so far i’ve tried some experiment from what i found in google. this one is closer. Log.d display the result data. but when i use to String[] it doesn’t show in my chart.

JavaScript

this is my json

JavaScript

I appreciate any help

Advertisement

Answer

See the below code carefully

JavaScript

area = new String[]{get.getArea()}; method in for loop so every time it’s update area variable right so you final got only one value inside the area variable so please make changes as mentioned below in your code

JavaScript

I hope it’s helps you thanks

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement