当前位置: 首页>>代码示例>>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;未经允许,请勿转载。