本文整理匯總了Java中com.jjoe64.graphview.GraphView.setTitle方法的典型用法代碼示例。如果您正苦於以下問題:Java GraphView.setTitle方法的具體用法?Java GraphView.setTitle怎麽用?Java GraphView.setTitle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.jjoe64.graphview.GraphView
的用法示例。
在下文中一共展示了GraphView.setTitle方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onStart
import com.jjoe64.graphview.GraphView; //導入方法依賴的package包/類
@Override
protected void onStart() {
super.onStart();
// draw Graph of RouteHistory
GraphView graph = (GraphView) findViewById(R.id.view_route_history_stats);
RouteHistory rh = helper.getRouteHistory();
Diagram diagram = new Diagram(rh);
graph.setTitleTextSize(75);
graph.getGridLabelRenderer().setVerticalAxisTitle(getResources().getString(R.string.route_history_vertical_axis));
graph.getGridLabelRenderer().setHorizontalAxisTitle(getResources().getString(R.string.route_history_horizontal_axis));
graph.setTitle(getResources().getString(R.string.route_history_title));
// activate horizontal zooming and scrolling
graph.getViewport().setScalable(true);
graph.addSeries(diagram.draw());
// draw Graph of last Route
GraphView dayGraph = (GraphView) findViewById(R.id.view_route_stats);
drawRouteGraph(0, dayGraph);
}
示例2: initUi
import com.jjoe64.graphview.GraphView; //導入方法依賴的package包/類
/**
* Init UI contols
*/
private void initUi(final View view) {
tvCellDescription = (TextView) view.findViewById(R.id.stats_cell_description);
tvCellStrength = (TextView) view.findViewById(R.id.stats_cell_strength);
tvWifiDescription = (TextView) view.findViewById(R.id.stats_wifi_description);
tvWifiStrength = (TextView) view.findViewById(R.id.stats_wifi_strength);
tvIgnored = (TextView) view.findViewById(R.id.stats_blacklisted);
tvFree = (TextView) view.findViewById(R.id.stats_free);
ivFree = (ImageView) view.findViewById(R.id.stats_icon_free);
ivAlert = (ImageView) view.findViewById(R.id.stats_icon_alert);
tvTechnology = (TextView) view.findViewById(R.id.tvTechnology);
gvGraph = (GraphView) view.findViewById(R.id.graph);
gvGraph.getViewport().setXAxisBoundsManual(true);
gvGraph.getViewport().setYAxisBoundsManual(true);
gvGraph.getViewport().setMinY(-100);
gvGraph.getViewport().setMaxY(-50);
gvGraph.setTitle(this.getString(R.string.graph_title));
gvGraph.getGridLabelRenderer().setVerticalAxisTitle(this.getString(R.string.dbm));
gvGraph.getGridLabelRenderer().setHorizontalLabelsVisible(false);
gvGraph.getGridLabelRenderer().setHighlightZeroLines(false);
gvGraph.getGridLabelRenderer().setGridStyle(GridLabelRenderer.GridStyle.HORIZONTAL);
gvGraph.getGridLabelRenderer().setNumVerticalLabels(3);
gvGraph.getViewport().setMinX(0);
gvGraph.getViewport().setMaxX(60);
}
示例3: createCompletionGraph
import com.jjoe64.graphview.GraphView; //導入方法依賴的package包/類
/**
* Creates the completion metrics graph for the habit
*/
private void createCompletionGraph() {
int startedWeeksAgo = DateUtil.WeekDifference(habit.getStartDate(), DateTime.now());
if (startedWeeksAgo > 3) startedWeeksAgo = 3;
Double runningTotal = 0.00;
Double[] runningAverages = new Double[4];
for (int i = -1 * startedWeeksAgo; i <= 0; i++) {
runningTotal += completionMetrics.get(3+i);
runningAverages[3+i] = runningTotal/(startedWeeksAgo + i + 1);
}
ArrayList<DataPoint> dataPoints = new ArrayList<>();
for (int i = -1 * startedWeeksAgo; i <= 0; i++) {
if(runningAverages[3+i] == null) runningAverages[3+i] = 0.00;
dataPoints.add(new DataPoint(i, runningAverages[3+i]));
}
if(dataPoints.size() == 1) {
dataPoints.add(new DataPoint(-1, 0.0));
Collections.reverse(dataPoints);
}
//habit.setCompletionRate(runningAverages[3]);
//habitRepository.update(habit.getKey(), habit);
GraphView graph = (GraphView) findViewById(R.id.graph);
graph.removeAllSeries();
LineGraphSeries<DataPoint> series = new LineGraphSeries<>(dataPoints.toArray(new DataPoint[dataPoints.size()]));
series.setTitle("Completion Metrics");
series.setColor(Color.RED);
graph.getViewport().setMinX(-3);
graph.getViewport().setMaxX(0);
graph.getViewport().setMinY(0);
graph.getViewport().setMaxY(100);
graph.getViewport().setYAxisBoundsManual(true);
graph.getViewport().setXAxisBoundsManual(true);
String[] xLabels = new String[4];
ArrayList<Week> pastNWeeks = DateUtil.GetNPastWeeks(DateTime.now(), 4);
for (int i = 0; i < 4; i++) {
xLabels[i] = pastNWeeks.get(i).getStartOfWeek().toString("MMM d");
}
// use static labels for horizontal and vertical labels
StaticLabelsFormatter staticLabelsFormatter = new StaticLabelsFormatter(graph);
staticLabelsFormatter.setVerticalLabels(new String[] {"0%","20%","40%","60%","80%","100%"});
staticLabelsFormatter.setHorizontalLabels(xLabels);
graph.setTitle("Events completed over last 4 weeks");
int bgColor = (15 & 0xff) << 24 | (0xD3 & 0xff) << 16 | (0x2F & 0xff) << 8 | (0x2F & 0xff);
graph.getViewport().setBackgroundColor(bgColor);
graph.getGridLabelRenderer().setLabelFormatter(staticLabelsFormatter);
graph.getGridLabelRenderer().setHighlightZeroLines(false);
graph.getGridLabelRenderer().setNumHorizontalLabels(4);
graph.getGridLabelRenderer().setNumVerticalLabels(6);
graph.addSeries(series);
}
示例4: onCreate
import com.jjoe64.graphview.GraphView; //導入方法依賴的package包/類
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.wifi_details);
HashMap<String, String> WifiInfoIntent;
UseWifiDetector = false;
StartWifiInfo = (HashMap<String, String>)(getIntent().getSerializableExtra("WifiInfo"));
NetworkBSSID = StartWifiInfo.get("BSSID");
txtBSSID = (TextView)this.findViewById(R.id.txtDetailsBSSID);
txtESSID = (TextView)this.findViewById(R.id.txtDetailsESSID);
txtFreq = (TextView)this.findViewById(R.id.txtDetailsFreq);
txtSignal = (TextView)this.findViewById(R.id.txtDetailsSignal);
txtChannel = (TextView)this.findViewById(R.id.txtDetailsChannel);
chkbUseDetector = (CheckBox)this.findViewById(R.id.chkbUseDetector);
llGrphView = (LinearLayout)this.findViewById(R.id.llGrphView);
mSoundPool = new SoundPool(1, AudioManager.STREAM_MUSIC, 0);
// Graph init
iGraphPointCount = 0;
graphSeries = new LineGraphSeries<>();
graphView = new GraphView(this);
graphView.getGridLabelRenderer().setNumVerticalLabels(2);
graphView.getGridLabelRenderer().setHorizontalLabelsVisible(false);
graphView.getViewport().setMinY(0);
graphView.getViewport().setMaxY(100);
graphView.getViewport().setYAxisBoundsStatus(Viewport.AxisBoundsStatus.FIX);
graphView.getViewport().setYAxisBoundsManual(true);
graphView.setTitle("Signal graph");
graphView.addSeries(graphSeries);
llGrphView.addView(graphView);
chkbUseDetector.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
UseWifiDetector = isChecked;
if (UseWifiDetector) {
DetectorThread = new Thread(new Runnable() {
@Override
public void run() {
DetectorWorker();
}
});
DetectorThread.start();
}
}
});
setBSSID(StartWifiInfo.get("BSSID"));
setESSID(StartWifiInfo.get("SSID"));
setFreq(StartWifiInfo.get("Freq"));
setSignal(StartWifiInfo.get("Signal"));
WifiMgr = (WifiManager) getSystemService(Context.WIFI_SERVICE);
ScanThread = new Thread(new Runnable() {
@Override
public void run() {
ScanWorker();
}
});
ScanThreadActive = true;
ScanThread.start();
}