Ask a question from expert

Ask now

Code. Plot Value Status[ low,normal,high] data against

2 Pages365 Words366 Views
   

Added on  2019-09-16

Code. Plot Value Status[ low,normal,high] data against

   Added on 2019-09-16

BookmarkShareRelated Documents
Code Plot Value Status[ low,normal,high] data against time and date saved on CSV file and display them in android line graph I successfully understand how to display the graph however I have problem on how to extract data from CSV file and plotted them in the line graph the x axis should be the time and data and the y axis represent the Value status .This what I tried as first step, can you explain to me how I can plot status against time and date package com.example.aliaaldhaheri.displaychart;import android.graphics.Color;import android.support.v7.app.AppCompatActivity;import android.os.Bundle;import com.androidplot.xy.LineAndPointFormatter;import com.androidplot.xy.PointLabelFormatter;import com.androidplot.xy.SimpleXYSeries;import com.androidplot.xy.XYPlot;import com.androidplot.xy.XYSeries;import java.util.Arrays;public class MainActivity extends AppCompatActivity {private XYPlot plot;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);// initialize our XYPlot reference:plot = (XYPlot) findViewById(R.id.plot);// XYSeries s1=new SimpleXYSeries(SimpleXYSeries.ArrayFormat.XY_VALS_INTERLEAVED,"series1",1,5,2,8,3,9); //plot.addSeries(s1,new LineAndPointFormatter(Color.GREEN,Color.GREEN,null,null)); // Create a couple arrays of y-values to plot:Number[] series1Numbers = {64, 100, 85, 100, 160, 70}; // get blood pressure vaules in array listXYSeries series1 = new SimpleXYSeries( Arrays.asList(series1Numbers), // SimpleXYSeries takes a Listso turn our array into a ListSimpleXYSeries.ArrayFormat.Y_VALS_ONLY, // Y_VALS_ONLY means use the element index as the x value"Blood Pressure"); // Set the display title of the seriesplot.setDomainLabel("Date");plot.setRangeLabel("Pressure Status");
Code. Plot Value Status[ low,normal,high] data against _1

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Generate a Standard Curve
|9
|1583
|88

Statistics and Maths : Assignment
|43
|6148
|41

MATLAB Coding for Recurrent Neural Network, Time Series Regression, and Customer Characteristics Analysis
|23
|2955
|446

Data Analysis: Private Capital Expenditure and Average Yield vs Rainfall
|6
|663
|329

Impact of International Trade on Economic Growth: A Study of Brazil and South Africa
|16
|3740
|264

Statistics for Business
|10
|733
|61