本文整理匯總了Java中org.achartengine.GraphicalView類的典型用法代碼示例。如果您正苦於以下問題:Java GraphicalView類的具體用法?Java GraphicalView怎麽用?Java GraphicalView使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
GraphicalView類屬於org.achartengine包,在下文中一共展示了GraphicalView類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: execute
import org.achartengine.GraphicalView; //導入依賴的package包/類
public GraphicalView execute(Context context){
int[] colors = new int[]{Color.GREEN, Color.LTGRAY, Color.BLUE, Color.RED, Color.DKGRAY, Color.MAGENTA};
DefaultRenderer renderer = buildCategoryRenderer(colors);
CategorySeries categorySeries = new CategorySeries("Resolution Ratio Chart");
// Calculating normalization coefficient
double valueSum = 0;
for(int i = 0;i < value.length;i++){
valueSum += value[i];
}
// Adding data to Series
for(int i = 0;i < Playbackquality.length;i++){
categorySeries.add(Playbackquality[i], value[i]/valueSum);
}
return ChartFactory.getPieChartView(context, categorySeries, renderer);
}
示例2: onPostExecute
import org.achartengine.GraphicalView; //導入依賴的package包/類
@Override
protected void onPostExecute(Boolean result) {
if (result == true) {
BarGraphDrawer barGraph = new BarGraphDrawer(label,
MainActivity.getDeviceWidth(getSherlockActivity()),
verdictSeries);
GraphicalView gView = barGraph.getView(getSherlockActivity());
ViewGroup vg = (ViewGroup) getSherlockActivity().findViewById(
R.id.bar_graph);
vg.removeAllViews();
vg.refreshDrawableState();
vg.addView(gView);
setContentShown(true);
}
return;
}
示例3: swapAnswerBars
import org.achartengine.GraphicalView; //導入依賴的package包/類
/**
* Clears bar chart and replaces old bar chart with new one.
* Switches display of correct answer.
*/
public void swapAnswerBars() {
_graphArea.removeAllViews();
GraphicalView barChartView;
BarChartFactory factory = new BarChartFactory(getActivity());
if (_showCorrect) {
barChartView = factory.generateBar(_votesToDisplay, _questionModel, false);
}
else {
barChartView = factory.generateBar(_votesToDisplay, _questionModel, true);
}
_graphArea.addView(barChartView);
_showCorrect = !_showCorrect;
}
示例4: createChart
import org.achartengine.GraphicalView; //導入依賴的package包/類
private GraphicalView createChart(Context context, ResponseGetDeviceInfo deviceInfo) {
int[] colors = new int[] { context.getResources().getColor(R.color.darkRed),
context.getResources().getColor(R.color.verdeOscuro)};
DefaultRenderer renderer = buildCategoryRenderer(colors);
renderer.setZoomButtonsVisible(true);
renderer.setZoomEnabled(true);
renderer.setChartTitleTextSize(20);
renderer.setLabelsColor(Color.BLACK);
CategorySeries categorySeries = new CategorySeries("");
try {
//Title in the graph
renderer.setChartTitle(deviceInfo.getAccessPath() + " ("+deviceInfo.getSizeHuman()+")"); //It is the drive name
long usedInNumeric = deviceInfo.getSize() - deviceInfo.getFreeDiskSpace();
//TODO i18n words 'used' and 'free'
categorySeries.add("Used " + deviceInfo.getUsedDiskSpaceHuman(), usedInNumeric);
categorySeries.add("Free " + deviceInfo.getFreeDiskSpaceHuman(), deviceInfo.getFreeDiskSpace());
} catch (Exception e) {
showToastError(R.string.error_parsing_data);
}
return ChartFactory.getPieChartView(context, categorySeries, renderer);
}
示例5: getGraph
import org.achartengine.GraphicalView; //導入依賴的package包/類
public GraphicalView getGraph(Context context) {
String title = "";
double[] xValues = new double[0];
double[] yValues = new double[0];
mRenderer = buildRenderer(context);
mDataset = buildDataset(title, xValues, yValues);
mLogic.setGraph(this);
mChartView = ChartFactory.getLineChartView(context, mDataset, mRenderer);
mChartView.addPanListener(new PanListener() {
@Override
public void panApplied() {
mLogic.mGraphModule.updateGraphCatchErrors(Graph.this);
}
});
mChartView.addZoomListener(new ZoomListener() {
@Override
public void zoomReset() {
mLogic.mGraphModule.updateGraphCatchErrors(Graph.this);
}
@Override
public void zoomApplied(ZoomEvent event) {
mLogic.mGraphModule.updateGraphCatchErrors(Graph.this);
}
}, true, true);
mLogic.mGraphModule.updateGraphCatchErrors(this);
return mChartView;
}
示例6: init
import org.achartengine.GraphicalView; //導入依賴的package包/類
/**
* Initialize ECG chart.
*/
private void init() {
this.mECGList = new ArrayList<>();
this.mECGList.add(new XYSeries(TITLES[0]));
XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
dataset.addAllSeries(this.mECGList);
this.mXYMultipleSeriesRenderer = buildRenderer();
mLineChart = new LineChart(dataset, mXYMultipleSeriesRenderer);
mGraphicalView = new GraphicalView(getActivity(), mLineChart);
}
示例7: init
import org.achartengine.GraphicalView; //導入依賴的package包/類
/**
* Initialilze chart.
*/
private void init() {
mACCList = new ArrayList<>();
mACCList.add(new XYSeries(TITLES[0]));
mACCList.add(new XYSeries(TITLES[1]));
mACCList.add(new XYSeries(TITLES[2]));
XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
dataset.addAllSeries(mACCList);
this.mXYMultipleSeriesRenderer = buildRenderer();
mLineChart = new LineChart(dataset, mXYMultipleSeriesRenderer);
mGraphicalView = new GraphicalView(getActivity(), mLineChart);
}
開發者ID:DeviceConnect,項目名稱:DeviceConnect-Android,代碼行數:16,代碼來源:HitoeProfileDeviceOrientationFragment.java
示例8: getChartGraph
import org.achartengine.GraphicalView; //導入依賴的package包/類
@Override
public GraphicalView getChartGraph(Activity activity) {
setUpRenderer(activity);
mCurrentSeries = new XYSeries("Data");
mGoalSeries = new XYSeries("Goal");
mDataset.addSeries(mCurrentSeries);
mDataset.addSeries(mGoalSeries);
CombinedXYChart.XYCombinedChartDef[] types = new CombinedXYChart.XYCombinedChartDef[] {new CombinedXYChart.XYCombinedChartDef(BarChart.TYPE, 0), new CombinedXYChart.XYCombinedChartDef(BarChart.TYPE, 1)};
return ChartFactory.getCombinedXYChartView(activity, mDataset, mRenderer, types);
}
示例9: onCreate
import org.achartengine.GraphicalView; //導入依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getActionBar().setTitle(" Played bitrates for different ISPs");
LinearLayout parent=new LinearLayout(this);
parent.setOrientation(LinearLayout.VERTICAL);
getISP(this);
Set<String> keyset = map.keySet();
String[] ISP = keyset.toArray(new String[keyset.size()]);
for (int i=0; i<ISP.length; i++){
if(ISP[i].equals("")){
continue;
}
LinearLayout layout = new LinearLayout(this);
layout.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 600));
layout.setBottom(30);
layout.setOrientation(LinearLayout.VERTICAL);
GraphicalView piechart = new PieChart(ISP[i], readInfo(this, ISP[i])).execute(this);
layout.addView(piechart, new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT));
parent.addView(layout);
}
ScrollView scroll = new ScrollView(this);
scroll.setBackgroundColor(Color.BLACK);
scroll.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
scroll.addView(parent);
setContentView(scroll);
}
示例10: onStart
import org.achartengine.GraphicalView; //導入依賴的package包/類
@Override
public void onStart() {
super.onStart();
LineGraph lineGraph = new LineGraph();
GraphicalView gView = lineGraph.getView(getActivity());
LinearLayout layout = (LinearLayout) getActivity().findViewById(R.id.line_graph);
layout.addView(gView);
}
示例11: onStart
import org.achartengine.GraphicalView; //導入依賴的package包/類
@Override
public void onStart() {
super.onStart();
LevelGraphDrawer barGraph = new LevelGraphDrawer(
getString(R.string.solved_problem_level),
MainActivity.getDeviceWidth(getSherlockActivity()) - 20,
verdictSeries);
GraphicalView gView = barGraph.getView(getActivity());
ViewGroup vg = (ViewGroup) getSherlockActivity().findViewById(
R.id.bar_graph);
vg.addView(gView);
}
示例12: onConfigurationChanged
import org.achartengine.GraphicalView; //導入依賴的package包/類
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
LevelGraphDrawer barGraph = new LevelGraphDrawer(
getString(R.string.solved_problem_level),
MainActivity.getDeviceWidth(getSherlockActivity()) - 20,
verdictSeries);
GraphicalView gView = barGraph.getView(getSherlockActivity());
ViewGroup vg = (ViewGroup) getSherlockActivity().findViewById(
R.id.bar_graph);
vg.removeAllViews();
vg.refreshDrawableState();
vg.addView(gView);
}
示例13: onConfigurationChanged
import org.achartengine.GraphicalView; //導入依賴的package包/類
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
BarGraphDrawer barGraph = new BarGraphDrawer("Submission Statistics",
MainActivity.getDeviceWidth(getSherlockActivity()),
verdictSeries);
GraphicalView gView = barGraph.getView(getSherlockActivity());
ViewGroup vg = (ViewGroup) getSherlockActivity().findViewById(
R.id.bar_graph);
vg.removeAllViews();
vg.refreshDrawableState();
vg.addView(gView);
}
示例14: onStart
import org.achartengine.GraphicalView; //導入依賴的package包/類
@SuppressLint("NewApi")
@Override
public void onStart() {
super.onStart();
BarGraphDrawer barGraph = new BarGraphDrawer("Submission Statistics",
MainActivity.getDeviceWidth(getSherlockActivity()),
verdictSeries);
GraphicalView gView = barGraph.getView(getSherlockActivity());
ViewGroup vg = (ViewGroup) getSherlockActivity().findViewById(
R.id.bar_graph);
vg.addView(gView);
}
示例15: onConfigurationChanged
import org.achartengine.GraphicalView; //導入依賴的package包/類
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
BarGraphDrawer barGraph = new BarGraphDrawer(label,
MainActivity.getDeviceWidth(getSherlockActivity()),
verdictSeries);
GraphicalView gView = barGraph.getView(getSherlockActivity());
ViewGroup vg = (ViewGroup) getSherlockActivity().findViewById(
R.id.bar_graph);
vg.removeAllViews();
vg.refreshDrawableState();
vg.addView(gView);
}