本文整理匯總了Java中org.achartengine.ChartFactory.getLineChartIntent方法的典型用法代碼示例。如果您正苦於以下問題:Java ChartFactory.getLineChartIntent方法的具體用法?Java ChartFactory.getLineChartIntent怎麽用?Java ChartFactory.getLineChartIntent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.achartengine.ChartFactory
的用法示例。
在下文中一共展示了ChartFactory.getLineChartIntent方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onListItemClick
import org.achartengine.ChartFactory; //導入方法依賴的package包/類
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
switch (position) {
case 0:
Intent intent = ChartFactory.getLineChartIntent(this, getDemoDataset(), getDemoRenderer());
startActivity(intent);
break;
case 1:
intent = ChartFactory.getScatterChartIntent(this, getDemoDataset(), getDemoRenderer());
startActivity(intent);
break;
case 2:
intent = ChartFactory.getTimeChartIntent(this, getDateDemoDataset(), getDemoRenderer(), null);
startActivity(intent);
break;
case 3:
XYMultipleSeriesRenderer renderer = getBarDemoRenderer();
setChartSettings(renderer);
intent = ChartFactory.getBarChartIntent(this, getBarDemoDataset(), renderer, Type.DEFAULT);
startActivity(intent);
break;
}
}
示例2: execute
import org.achartengine.ChartFactory; //導入方法依賴的package包/類
/**
* Executes the chart demo.
* @param context the context
* @return the built intent
*/
public Intent execute(Context context) {
String[] titles = new String[] { "sin", "cos" };
List<double[]> x = new ArrayList<double[]>();
List<double[]> values = new ArrayList<double[]>();
int step = 4;
int count = 360 / step + 1;
x.add(new double[count]);
x.add(new double[count]);
double[] sinValues = new double[count];
double[] cosValues = new double[count];
values.add(sinValues);
values.add(cosValues);
for (int i = 0; i < count; i++) {
int angle = i * step;
x.get(0)[i] = angle;
x.get(1)[i] = angle;
double rAngle = Math.toRadians(angle);
sinValues[i] = Math.sin(rAngle);
cosValues[i] = Math.cos(rAngle);
}
int [] colors = new int[] { Color.BLUE, Color.CYAN };
PointStyle[] styles = new PointStyle[] { PointStyle.POINT, PointStyle.POINT };
XYMultipleSeriesRenderer renderer = buildRenderer(colors, styles);
setChartSettings(renderer, "Trigonometric functions", "X (in degrees)", "Y", 0, 360, -1, 1,
Color.GRAY, Color.LTGRAY);
renderer.setXLabels(20);
renderer.setYLabels(10);
return ChartFactory.getLineChartIntent(context, buildDataset(titles, x, values), renderer);
}
示例3: execute
import org.achartengine.ChartFactory; //導入方法依賴的package包/類
public Intent execute(Context context){
readInfo(context);
XYMultipleSeriesRenderer multiRenderer = customizeMultipleRender();
Set<String> keyset = map.keySet();
String[] ISP = keyset.toArray(new String[keyset.size()]);
// Adding data
XYSeries[] SingleSeries = new XYSeries[ISP.length];
for(int i = 0; i< ISP.length; i++){
SingleSeries[i] = new XYSeries(ISP[i]);
}
for(int i=0; i < xlabel.length; i++){
for(int j = 0; j < ISP.length; j++){
int[] data = map.get(ISP[j]);
if (timelengthbymonth[i] == 0){
SingleSeries[j].add(xlabel[i], 0);
}
else{
double d=(double)data[i]/(double)timelengthbymonth[i];
d=d*100.0*100.0;
d=(double)Math.ceil(d)/100;
SingleSeries[j].add(xlabel[i], d);
}
}
}
XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
for(int i = 0; i< ISP.length; i++){
// Creating a dataset for each series
dataset.addSeries(SingleSeries[i]);
// Building XYSeriesRenderer for each isp
XYSeriesRenderer renderer = buildXYSeriesRender(colorlist[i%colorlist.length], pointstylelist[i%pointstylelist.length]);
multiRenderer.addSeriesRenderer(renderer);
}
Intent intent = ChartFactory.getLineChartIntent(context, dataset, multiRenderer,
" Avg. rebuffering ratio (%)");
return intent;
}
示例4: execute
import org.achartengine.ChartFactory; //導入方法依賴的package包/類
public Intent execute(Context context){
readInfo(context);
XYMultipleSeriesRenderer multiRenderer = customizeMultipleRender();
Set<String> keyset = map.keySet();
String[] ISP = keyset.toArray(new String[keyset.size()]);
// Adding data
XYSeries[] SingleSeries = new XYSeries[ISP.length];
for(int i = 0; i< ISP.length; i++){
SingleSeries[i] = new XYSeries(ISP[i]);
}
for(int i = 0; i< ISP.length; i++){
ArrayList<String> data = map.get(ISP[i]);
Log.i("dataSize: ",Integer.toString(data.size()));
if(data.size()>xlabelCount) xlabelCount=data.size();
Log.i("xlabelCountT: ",Integer.toString(xlabelCount));
for(int j=0;j<data.size();j++){
String str=data.get(j);
String[] str_split=str.split("&");
String str_date=str_split[0];
String str_rb_ratio=str_split[1];
SingleSeries[i].add(j, Double.parseDouble(str_rb_ratio));
/**
* Add annotation for date
*/
SingleSeries[i].addAnnotation(str_date,j,Double.parseDouble(str_rb_ratio)+0.8);
}
}
/**
* Update x labels
*/
for(int i=0;i<xlabelCount;i++){
multiRenderer.addXTextLabel(i, Integer.toString(i+1));
}
XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
for(int i = 0; i< ISP.length; i++){
// Creating a dataset for each series
dataset.addSeries(SingleSeries[i]);
// Building XYSeriesRenderer for each isp
XYSeriesRenderer renderer = buildXYSeriesRender(colorlist[i%colorlist.length], pointstylelist[i%pointstylelist.length]);
multiRenderer.addSeriesRenderer(renderer);
}
Intent intent = ChartFactory.getLineChartIntent(context, dataset, multiRenderer,
" Rebuffering ratio (%) per session");
return intent;
}