當前位置: 首頁>>代碼示例>>Java>>正文


Java GraphView.setScalable方法代碼示例

本文整理匯總了Java中com.jjoe64.graphview.GraphView.setScalable方法的典型用法代碼示例。如果您正苦於以下問題:Java GraphView.setScalable方法的具體用法?Java GraphView.setScalable怎麽用?Java GraphView.setScalable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.jjoe64.graphview.GraphView的用法示例。


在下文中一共展示了GraphView.setScalable方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initGraph

import com.jjoe64.graphview.GraphView; //導入方法依賴的package包/類
@AfterViews
void initGraph() {
    if (mScoreResponse != null) {
        final TreeMap<Long, Double> scoreArray = mScoreResponse.getScoreArray();
        final double width = scoreArray.lastKey() - scoreArray.firstKey();
        final GraphView graphView = new LineGraphView(getActivity(), getString(R.string.chart_title));

        GraphViewData[] data = new GraphViewData[scoreArray.size()];
        int i = 0;
        for (Map.Entry<Long, Double> entry : scoreArray.entrySet()) {
            data[i] = new GraphViewData(entry.getKey(), entry.getValue());
            i++;
        }

        final GraphViewSeriesStyle graphViewSeriesStyle = new GraphViewSeriesStyle(Color.WHITE, 4);
        graphView.addSeries(new GraphViewSeries("Score", graphViewSeriesStyle, data));
        graphView.setViewPort(0, width);
        graphView.setScalable(true);
        graphView.setScrollable(true);
        graphContainer.addView(graphView);
    }
}
 
開發者ID:runningcode,項目名稱:Hipster-Visualization,代碼行數:23,代碼來源:GraphFragment.java

示例2: datosGrafico

import com.jjoe64.graphview.GraphView; //導入方法依賴的package包/類
private void datosGrafico(String dorsal,String dato){
	//Obtenemos los valores
	SentenciasSQLiteDatosGrafico.getDatosGrafico(this,dorsal,dato);
	SentenciasSQLiteDatosGrafico.getDiasGrafico(this);
	int valores[]=SentenciasSQLiteDatosGrafico.getDatos();
	int[] datos=valores;
	String[] fechas=SentenciasSQLiteDatosGrafico.getDias();
	
	TextView tituloDatos=(TextView) findViewById(R.id.graphic_data);
	
	if(valores.length==0){
		tituloDatos.setText(R.string.no_data);
	}else{
		tituloDatos.setText(R.string.yes_data);
	}
	
	GraphViewData[] datosY=new GraphViewData[datos.length];
	for(int num=0;num<datos.length;num++){
	   datosY[num]=new GraphViewData(num,datos[num]);
	}
	GraphViewSeries series1=new GraphViewSeries(datosY);
	
	GraphViewData[] datosX=new GraphViewData[datos.length];
	for(int num=0;num<datos.length;num++){
	   datosX[num]=new GraphViewData(num,num);
	}
	GraphViewSeries series2=new GraphViewSeries(datosX);
	
	GraphView graphView=new BarGraphView(this,"");
	if(valores.length==0 & fechas.length==0){
		graphView.getGraphViewStyle().setNumVerticalLabels(1);
		graphView.getGraphViewStyle().setNumHorizontalLabels(1);
	}else if(valores.length==0 & fechas.length!=0){
		graphView.getGraphViewStyle().setNumVerticalLabels(1);
	}else if(valores.length!=0 & fechas.length==0){
		graphView.getGraphViewStyle().setNumHorizontalLabels(1);
	}
	
	graphView.setHorizontalLabels(fechas);
	graphView.setViewPort(1,1);
	graphView.setScalable(true);
	
	graphView.addSeries(series2);
	graphView.addSeries(series1);
	
	LinearLayout layout=(LinearLayout) findViewById(R.id.graph1);
	layout.addView(graphView);
}
 
開發者ID:DAM2-GOW,項目名稱:FCM,代碼行數:49,代碼來源:EstadisticasJugador.java


注:本文中的com.jjoe64.graphview.GraphView.setScalable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。