Ask a question to Desklib · AI bot


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

2 Pages365 Words366 Views

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;import;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(;// 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

Found this document preview useful?

Related Documents
Generate a Standard Curve

Statistics and Maths : Assignment

MATLAB Coding for Recurrent Neural Network, Time Series Regression, and Customer Characteristics Analysis

Data Analysis: Private Capital Expenditure and Average Yield vs Rainfall

Impact of International Trade on Economic Growth: A Study of Brazil and South Africa

Statistics for Business