当前位置: 首页>>代码示例>>Java>>正文


Java GraphView.setTitle方法代码示例

本文整理汇总了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);
}
 
开发者ID:BernhardWebstudio,项目名称:ShadowTravelor,代码行数:22,代码来源:MainActivity.java

示例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);
}
 
开发者ID:openbmap,项目名称:radiocells-scanner-android,代码行数:32,代码来源:StatsActivity.java

示例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);
}
 
开发者ID:CMPUT301F17T13,项目名称:cat-is-a-dog,代码行数:67,代码来源:ViewHabitActivity.java

示例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();
}
 
开发者ID:FusixGit,项目名称:WiFiPasswordSearcher,代码行数:72,代码来源:WifiDetails.java


注:本文中的com.jjoe64.graphview.GraphView.setTitle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。