本文整理匯總了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);
}
}
示例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);
}