本文整理匯總了Java中org.achartengine.ChartFactory.getBarChartIntent方法的典型用法代碼示例。如果您正苦於以下問題:Java ChartFactory.getBarChartIntent方法的具體用法?Java ChartFactory.getBarChartIntent怎麽用?Java ChartFactory.getBarChartIntent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.achartengine.ChartFactory
的用法示例。
在下文中一共展示了ChartFactory.getBarChartIntent方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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[] { "2008", "2007" };
List<double[]> values = new ArrayList<double[]>();
values.add(new double[] { 14230, 12300, 14240, 15244, 15900, 19200, 22030, 21200, 19500, 15500,
12600, 14000 });
values.add(new double[] { 5230, 7300, 9240, 10540, 7900, 9200, 12030, 11200, 9500, 10500,
11600, 13500 });
int[] colors = new int[] { Color.BLUE, Color.CYAN };
XYMultipleSeriesRenderer renderer = buildBarRenderer(colors);
setChartSettings(renderer, "Monthly sales in the last 2 years", "Month", "Units sold", 0.5,
12.5, 0, 24000, Color.GRAY, Color.LTGRAY);
((XYSeriesRenderer) renderer.getSeriesRendererAt(0)).setDisplayChartValues(true);
((XYSeriesRenderer) renderer.getSeriesRendererAt(1)).setDisplayChartValues(true);
renderer.setXLabels(12);
renderer.setYLabels(10);
renderer.setXLabelsAlign(Align.LEFT);
renderer.setYLabelsAlign(Align.LEFT);
renderer.setPanEnabled(true, false);
// renderer.setZoomEnabled(false);
renderer.setZoomRate(1.1f);
renderer.setBarSpacing(0.5f);
return ChartFactory.getBarChartIntent(context, buildBarDataset(titles, values), renderer,
Type.STACKED);
}
示例2: 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;
}
}
示例3: 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[] { "2008", "2007" };
List<double[]> values = new ArrayList<double[]>();
values.add(new double[] { 14230, 12300, 14240, 15244, 15900, 19200, 22030, 21200, 19500, 15500,
12600, 14000 });
values.add(new double[] { 5230, 7300, 9240, 10540, 7900, 9200, 12030, 11200, 9500, 10500,
11600, 13500 });
int[] colors = new int[] { Color.BLUE, Color.CYAN };
XYMultipleSeriesRenderer renderer = buildBarRenderer(colors);
setChartSettings(renderer, "Monthly sales in the last 2 years", "Month", "Units sold", 0.5,
12.5, 0, 24000, Color.GRAY, Color.LTGRAY);
renderer.getSeriesRendererAt(0).setDisplayChartValues(true);
renderer.getSeriesRendererAt(1).setDisplayChartValues(true);
renderer.setXLabels(12);
renderer.setYLabels(10);
renderer.setXLabelsAlign(Align.LEFT);
renderer.setYLabelsAlign(Align.LEFT);
renderer.setPanEnabled(true, false);
// renderer.setZoomEnabled(false);
renderer.setZoomRate(1.1f);
renderer.setBarSpacing(0.5f);
return ChartFactory.getBarChartIntent(context, buildBarDataset(titles, values), renderer,
Type.STACKED);
}
示例4: 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[] { "2007", "2008" };
List<double[]> values = new ArrayList<double[]>();
values.add(new double[] { 5230, 7300, 9240, 10540, 7900, 9200, 12030, 11200, 9500, 10500,
11600, 13500 });
values.add(new double[] { 14230, 12300, 14240, 15244, 15900, 19200, 22030, 21200, 19500, 15500,
12600, 14000 });
int[] colors = new int[] { Color.CYAN, Color.BLUE };
XYMultipleSeriesRenderer renderer = buildBarRenderer(colors);
renderer.setOrientation(Orientation.VERTICAL);
setChartSettings(renderer, "Monthly sales in the last 2 years", "Month", "Units sold", 0.5,
12.5, 0, 24000, Color.GRAY, Color.LTGRAY);
renderer.setXLabels(1);
renderer.setYLabels(10);
renderer.addXTextLabel(1, "Jan");
renderer.addXTextLabel(3, "Mar");
renderer.addXTextLabel(5, "May");
renderer.addXTextLabel(7, "Jul");
renderer.addXTextLabel(10, "Oct");
renderer.addXTextLabel(12, "Dec");
int length = renderer.getSeriesRendererCount();
for (int i = 0; i < length; i++) {
XYSeriesRenderer seriesRenderer = (XYSeriesRenderer) renderer.getSeriesRendererAt(i);
seriesRenderer.setDisplayChartValues(true);
}
return ChartFactory.getBarChartIntent(context, buildBarDataset(titles, values), renderer,
Type.DEFAULT);
}
示例5: execute
import org.achartengine.ChartFactory; //導入方法依賴的package包/類
/**
* Executes the chart demo.
*
* @param context
* the context
* @return the built intent
*/
public Intent execute(Context context) {
MainActivity Main = (MainActivity) context;
BuildChart(Main);
return ChartFactory.getBarChartIntent(context,
buildBarDataset(titles, values), renderer, Type.DEFAULT);
}
示例6: 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[] { "2007", "2008" };
List<double[]> values = new ArrayList<double[]>();
values.add(new double[] { 5230, 7300, 9240, 10540, 7900, 9200, 12030, 11200, 9500, 10500,
11600, 13500 });
values.add(new double[] { 14230, 12300, 14240, 15244, 15900, 19200, 22030, 21200, 19500, 15500,
12600, 14000 });
int[] colors = new int[] { Color.CYAN, Color.BLUE };
XYMultipleSeriesRenderer renderer = buildBarRenderer(colors);
renderer.setOrientation(Orientation.VERTICAL);
setChartSettings(renderer, "Monthly sales in the last 2 years", "Month", "Units sold", 0.5,
12.5, 0, 24000, Color.GRAY, Color.LTGRAY);
renderer.setXLabels(1);
renderer.setYLabels(10);
renderer.addXTextLabel(1, "Jan");
renderer.addXTextLabel(3, "Mar");
renderer.addXTextLabel(5, "May");
renderer.addXTextLabel(7, "Jul");
renderer.addXTextLabel(10, "Oct");
renderer.addXTextLabel(12, "Dec");
int length = renderer.getSeriesRendererCount();
for (int i = 0; i < length; i++) {
SimpleSeriesRenderer seriesRenderer = renderer.getSeriesRendererAt(i);
seriesRenderer.setDisplayChartValues(true);
}
return ChartFactory.getBarChartIntent(context, buildBarDataset(titles, values), renderer,
Type.DEFAULT);
}