本文整理汇总了Java中com.androidplot.xy.XYPlot类的典型用法代码示例。如果您正苦于以下问题:Java XYPlot类的具体用法?Java XYPlot怎么用?Java XYPlot使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
XYPlot类属于com.androidplot.xy包,在下文中一共展示了XYPlot类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.androidplot.xy.XYPlot; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (presenter == null) {
presenter = new StatsPresenter();
}
setContentView(R.layout.activity_stats);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
monthsNPlot = (XYPlot) findViewById(R.id.monthsNPlot);
avgScorePlot = (XYPlot) findViewById(R.id.avgScorePlot);
presenter.attachView(this);
}
示例2: onViewCreated
import com.androidplot.xy.XYPlot; //导入依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
xyPlot = (XYPlot) view.findViewById(R.id.accelerationGraph);
badText = (TextView) view.findViewById(R.id.badText);
normalText = (TextView) view.findViewById(R.id.normalText);
goodText = (TextView) view.findViewById(R.id.goodText);
perfectText = (TextView) view.findViewById(R.id.perfectText);
distanceValueText = (TextView) view.findViewById(R.id.distanceValueText);
speedText = (TextView) view.findViewById(R.id.speedText);
speedValueText = (TextView) view.findViewById(R.id.speedValueText);
bumpValueText = (TextView) view.findViewById(R.id.bumpValueText);
badQualityText = (TextView) view.findViewById(R.id.badQualityText);
normalQualityText = (TextView) view.findViewById(R.id.normalQualityText);
goodQualityText = (TextView) view.findViewById(R.id.goodQualityText);
perfectQualityText = (TextView) view.findViewById(R.id.perfectQualityText);
deviceIndicatorAngleBtn = (ImageView) view.findViewById(R.id.wrong_angle_icon);
gpsIndicatorBtn = (ImageView) view.findViewById(R.id.wrong_gps_icon);
startMeasurementsBtn = (Button) view.findViewById(R.id.startMeasurementsBtn);
roadIntervalValue = (TextView) view.findViewById(R.id.roadIntervalValue);
roadIntervalText = (TextView) view.findViewById(R.id.roadIntervalText);
recordStatusValue = (TextView) view.findViewById(R.id.recordStatusValue);
itemsCntValueText = (TextView) view.findViewById(R.id.itemsCntValueText);
intervalsCntValueText = (TextView) view.findViewById(R.id.intervalsCntValueText);
initUI();
}
示例3: drawSeries
import com.androidplot.xy.XYPlot; //导入依赖的package包/类
@Override
protected void drawSeries(Canvas canvas, RectF plotArea, XYSeries series, LineAndPointFormatter formatter) {
Number x = null;
Number y = null;
if (series != null && series.size() > 0) {
y = series.getY(0);
x = series.getX(0);
}
if (x == null || y == null) {
return;
}
XYPlot p = getPlot();
PointF thisPoint = ValPixConverter.valToPix(x, y, plotArea,
p.getCalculatedMinX(), p.getCalculatedMaxX(), p.getCalculatedMinY(), p.getCalculatedMaxY());
prev = new Point(thisPoint);
point = next = null;
pointsCounter = series.size();
super.drawSeries(canvas, plotArea, series, formatter);
}
示例4: onCreate
import com.androidplot.xy.XYPlot; //导入依赖的package包/类
@Override
protected void onCreate( Bundle savedInstanceState ) {
super.onCreate( savedInstanceState );
setContentView( R.layout.main );
mLoggerSingleton = LoggerSingleton.getInstance();
mStatus = ( TextView ) findViewById( R.id.main_status_lbl );
mRecords = ( TextView ) findViewById( R.id.main_records_lbl );
mDataRate = ( TextView ) findViewById( R.id.main_data_rate_lbl );
mFilename = ( TextView ) findViewById( R.id.main_filename_lbl );
mLogSize = ( TextView ) findViewById( R.id.main_log_size_lbl );
mElapsedTime = ( TextView ) findViewById( R.id.main_elapsed_time_lbl );
mHistoryPlot = ( XYPlot ) findViewById( R.id.main_history_plot );
mPrefs = new PreferencesUtils( this );
initPlot();
updateUI();
redrawPlot();
mLoggerSingleton.setOnEventListener( this );
updateElapsedTime();
}
示例5: WaterGraph
import com.androidplot.xy.XYPlot; //导入依赖的package包/类
public WaterGraph(
XYPlot graph,
Context context) {
this.graph = graph;
this.context = context;
graph.setOnTouchListener(this);
graph.setBorderStyle(Plot.BorderStyle.SQUARE, null, null);
graph.getLayoutManager().remove(graph.getLegendWidget());
graph.setTicksPerDomainLabel(3);
graph.setTicksPerRangeLabel(2);
graph.setBorderStyle(Plot.BorderStyle.NONE, null, null);
graph.setBackgroundColor(Color.BLACK);
graph.getGraphWidget().getBackgroundPaint().setColor(Color.BLACK);
graph.getGraphWidget().getGridBackgroundPaint().setColor(Color.BLACK);
}
示例6: initPlots
import com.androidplot.xy.XYPlot; //导入依赖的package包/类
/**
* Initialize the plots.
*/
private void initPlots()
{
View view = findViewById(R.id.ScrollView01);
view.setOnTouchListener(this);
// Create the graph plot
XYPlot plot = (XYPlot) findViewById(R.id.plot_sensor);
plot.setTitle("Acceleration");
dynamicPlot = new DynamicPlot(plot);
dynamicPlot.setMaxRange(1);
dynamicPlot.setMinRange(0);
// Add our magnitude plot.
addLPFMagnitudePlot();
}
示例7: setPlot
import com.androidplot.xy.XYPlot; //导入依赖的package包/类
public void setPlot(final XYPlot dynamicPlot) {
if (this.dynamicPlot != dynamicPlot) {
this.dynamicPlot = dynamicPlot;
dynamicPlot.setDomainStep(XYStepMode.SUBDIVIDE, 4);
dynamicPlot.setRangeStep(XYStepMode.SUBDIVIDE, 5);
dynamicPlot.getLegendWidget().setVisible(false);
dynamicPlot.getBackgroundPaint().setColor(Color.BLACK);
dynamicPlot.getGraphWidget().getBackgroundPaint().setColor(Color.BLACK);
dynamicPlot.getGraphWidget().getGridBackgroundPaint().setColor(Color.BLACK);
dynamicPlot.getGraphWidget().getDomainLabelPaint().setColor(Color.WHITE);
dynamicPlot.getGraphWidget().getRangeLabelPaint().setColor(Color.WHITE);
this.adjustYBoundaries();
dynamicPlot.setDomainValueFormat(new FormatDateLabel());
}
}
示例8: initComponents
import com.androidplot.xy.XYPlot; //导入依赖的package包/类
/******
*
* INITIALIZATION METHODS
*/
/*
* Get the layout components initialized and make their variable names global.
*/
private void initComponents(){
try{
tideGraph = new TideGraph((XYPlot)layoutView.findViewById(R.id.tideGraphComponent), dayView.getApplicationContext());
sunriseText = (TextView)layoutView.findViewById(R.id.sunriseText);
sunriseText.setTextColor(Color.rgb(0, 100, 0));
sunsetText = (TextView)layoutView.findViewById(R.id.sunsetText);
sunsetText.setTextColor(Color.rgb(100, 0, 0));
sunsetCountField = (TextView)layoutView.findViewById(R.id.sunsetCountField);
sunsetCountField.setTextColor(Color.rgb(100, 25, 25));
weatherDescriptionView = (TextView)layoutView.findViewById(R.id.weather_description);
weatherDescriptionView.setTextColor(Color.rgb(0, 150, 220));
((TextView)layoutView.findViewById(R.id.surf_head)).setTextColor(Color.rgb(0, 150, 220));
}
catch(Exception e){
System.err.println(e);
}
}
示例9: onCreate
import com.androidplot.xy.XYPlot; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_plot);
intent = getIntent();
String[] extras = (String[]) intent.getExtras().get("id");
id = extras[0];
name = extras[1];
setTitle("Graphs for " + name);
plotSource = PlotSource.getInstance();
domains = plotSource.getDomains();
temp_plot = (XYPlot) findViewById(R.id.plotTemperature);
hum_plot = (XYPlot) findViewById(R.id.plotHumidity);
pres_plot = (XYPlot) findViewById(R.id.plotPressure);
Ruuvitag[] series = plotSource.getSeriesForTag(id);
temp = new Number[series.length];
humidity = new Number[series.length];
pressure = new Number[series.length];
for(int i= 0; i < series.length; i++)
{
if(series[i] != null)
{
temp[i] = Double.parseDouble(series[i].getTemperature());
humidity[i] = Double.parseDouble(series[i].getHumidity());
pressure[i] = Double.parseDouble(series[i].getPressure());
}
}
}
开发者ID:CentriaUniversityOfAppliedSciences,项目名称:Android_RuuvitagScannner,代码行数:34,代码来源:PlotActivity.java
示例10: onCreate
import com.androidplot.xy.XYPlot; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
DsSensorManager.checkBtLePermissions(this, true);
mPlot = (XYPlot) findViewById(R.id.plotViewA);
mPlotData = new SimpleXYSeries("Sensor Values");
mPlotData.useImplicitXVals();
mPlot.addSeries(mPlotData, new LineAndPointFormatter(Color.rgb(100, 100, 200), null, null, new PointLabelFormatter(Color.DKGRAY)));
mPlot.setDomainLabel("Sample Index");
mPlot.setRangeLabel("Value");
}
示例11: DataPlotZoomListener
import com.androidplot.xy.XYPlot; //导入依赖的package包/类
public DataPlotZoomListener(XYPlot plot, PlotConfiguration pc, String start, String end)
{
this.plot = plot;
this.pc = pc;
this.start = start;
this.end = end;
this.valueData = new HashMap<>();
}
示例12: onCreate
import com.androidplot.xy.XYPlot; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) { // activity is strarted
// here
super.onCreate(savedInstanceState);
setContentView(R.layout.results_screen); // main menu view is loaded first
ht.getSeries();
audiogram = (XYPlot) findViewById(R.id.mySimpleXYPlotResult);
graphSettings();
drawBackground();
}
示例13: cargarGrafico
import com.androidplot.xy.XYPlot; //导入依赖的package包/类
public void cargarGrafico(XYPlot grafico, Number[] serie) {
XYSeries series1 = new SimpleXYSeries(Arrays.asList(serie),
SimpleXYSeries.ArrayFormat.Y_VALS_ONLY, getResources()
.getString(R.string.notas));
LineAndPointFormatter series1Format = new LineAndPointFormatter(
Color.rgb(255, 255, 255), Color.rgb(0, 153, 204),
Color.alpha(0), null);
grafico.destroyDrawingCache();
grafico.setScrollContainer(false);
grafico.clear();
grafico.addSeries(series1, series1Format);
}
示例14: DynamicPlot
import com.androidplot.xy.XYPlot; //导入依赖的package包/类
/**
* Initialize a new Acceleration View object.
*
* @param activity
* the Activity that owns this View.
*/
public DynamicPlot(XYPlot dynamicPlot)
{
this.dynamicPlot = dynamicPlot;
series = new SparseArray<SimpleXYSeries>();
history = new SparseArray<LinkedList<Number>>();
initPlot();
}
示例15: onResume
import com.androidplot.xy.XYPlot; //导入依赖的package包/类
@Override
public void onResume() {
super.onResume();
if (redrawer != null) {
redrawer.finish();
redrawer = null;
}
XYPlot aprHistoryPlot = (XYPlot) findViewById(R.id.aprHistoryPlot);
aprHistoryPlot.clear();
TextView tv = (TextView) findViewById(R.id.currentPulse);
mainPlot = new PulsePlot(aprHistoryPlot, tv, redrawer);
if (redrawer != null)
redrawer.start();
}