title: How to get specific data from Firebase Firestore and Create a Line Graph in Android?
body: <p>I'm relatively new to Android Studio and I was wondering if there is a way to retrieve a particular data from the Firebase Firestore Database and present that data into a Line Graph.</p>
  
  <p>At the moment I have created the database as you can see below: 
  <a href="https://i.stack.imgur.com/q89d6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q89d6.png" alt="enter image description here"></a> </p>
  
  <p>All I want to do is to show the glucose amount which is a Double in a Line graph. </p>
  
  <p>If someone could please help me out it would be greatly appreciated. </p>
  
  <p>Below I am showing the code that I have started with:</p>
  
  <pre><code>public class Chart extends AppCompatActivity {
      private FirebaseFirestore firestore = FirebaseFirestore.getInstance();
      private CollectionReference ref = (CollectionReference) firestore .collection("BGAndCarbohydrate");
  
      FirebaseAuth auth;
  
      String userID;
  
      GraphView graph;
      LineGraphSeries series;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_blood_glucose_chart);
  
          firebaseAuth = FirebaseAuth.getInstance();
          firebaseFirestore = FirebaseFirestore.getInstance();
  
          userID = firebaseAuth.getCurrentUser().getUid();
  
          graph = (GraphView) findViewById(R.id.graph);
          series = new LineGraphSeries();
          graph.addSeries(series);
      }
  }
  </code></pre>
  
  <p>Many thanks.</p>