本文整理匯總了Java中org.achartengine.renderer.XYMultipleSeriesRenderer.setZoomEnabled方法的典型用法代碼示例。如果您正苦於以下問題:Java XYMultipleSeriesRenderer.setZoomEnabled方法的具體用法?Java XYMultipleSeriesRenderer.setZoomEnabled怎麽用?Java XYMultipleSeriesRenderer.setZoomEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.achartengine.renderer.XYMultipleSeriesRenderer
的用法示例。
在下文中一共展示了XYMultipleSeriesRenderer.setZoomEnabled方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setUpRenderer
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
/**
* Set up a {@link XYMultipleSeriesRenderer} with the specs customized per plot tab.
*/
private void setUpRenderer(XYMultipleSeriesRenderer renderer, int tabNumber) {
renderer.setXAxisMin(0);
renderer.setXAxisMax(60);
renderer.setYAxisMin(RENDER_HEIGHTS[tabNumber][0]);
renderer.setYAxisMax(RENDER_HEIGHTS[tabNumber][1]);
renderer.setYAxisAlign(Align.RIGHT, 0);
renderer.setLegendTextSize(30);
renderer.setLabelsTextSize(30);
renderer.setYLabelsColor(0, Color.BLACK);
renderer.setXLabelsColor(Color.BLACK);
renderer.setFitLegend(true);
renderer.setShowGridX(true);
renderer.setMargins(new int[] {10, 10, 30, 10});
// setting the plot untouchable
renderer.setZoomEnabled(false, false);
renderer.setPanEnabled(false, true);
renderer.setClickEnabled(false);
renderer.setMarginsColor(Color.WHITE);
renderer.setChartTitle(mContext.getResources()
.getStringArray(R.array.plot_titles)[tabNumber]);
renderer.setChartTitleTextSize(50);
}
示例2: configureRenderer
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
/**
* Set some ChartView settings
*
* @param XYRenderer
*/
private void configureRenderer(XYMultipleSeriesRenderer XYRenderer)
{
XYRenderer.setAxesColor(Color.LTGRAY);
XYRenderer.setLabelsColor(Color.LTGRAY);
XYRenderer.setZoomEnabled(false, false);
XYRenderer.setAxisTitleTextSize(16);
XYRenderer.setChartTitleTextSize(20);
XYRenderer.setLabelsTextSize(15);
XYRenderer.setLegendTextSize(15);
XYRenderer.setPointSize(5f);
int margin = mContext.getResources().getDimensionPixelSize(R.dimen.chart_title_margin);
XYRenderer.setMargins(new int[] {margin, margin, margin, margin});
XYRenderer.setShowGrid(true);
XYRenderer.setXLabelsAlign(Align.RIGHT);
XYRenderer.setYLabels(20);
// if in ScrollView, need set
XYRenderer.setInScroll(true);
}
示例3: setUpRenderer
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
private void setUpRenderer(Activity activity) {
mRenderer = new XYMultipleSeriesRenderer();
// We want to avoid black border
mRenderer.setMarginsColor(Color.argb(0x00, 0xff, 0x00, 0x00)); // transparent margins
// Disable Pan on two axis
mRenderer.setPanEnabled(true, false);
mRenderer.setZoomEnabled(true, false);
mRenderer.setLabelsTextSize(getDPI(15));
mRenderer.setXLabelsColor(ContextCompat.getColor(activity,R.color.colorWhite));
mRenderer.setYLabelsColor(0, ContextCompat.getColor(activity,R.color.colorWhite));
mRenderer.setLabelsColor(ContextCompat.getColor(activity,R.color.colorWhite));
mRenderer.setAxesColor(ContextCompat.getColor(activity,R.color.colorWhite));
mRenderer.setShowGrid(true); // we show the grid
mRenderer.setXLabels(0);
}
示例4: buildRenderer
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
private XYMultipleSeriesRenderer buildRenderer(Context context) {
XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
renderer.setAxisTitleTextSize(16);
renderer.setChartTitleTextSize(0);
renderer.setLabelsTextSize(15);
renderer.setLegendTextSize(20);
renderer.setLegendHeight(22);
renderer.setPointSize(5f);
renderer.setMargins(new int[] { 20, 30, 15, 20 });
renderer.setChartTitle("");
renderer.setXTitle(context.getResources().getString(R.string.X));
renderer.setYTitle(context.getResources().getString(R.string.Y));
renderer.setXAxisMin(Graph.MIN_HEIGHT_X);
renderer.setXAxisMax(Graph.MAX_HEIGHT_X);
renderer.setYAxisMin(Graph.MIN_HEIGHT_Y);
renderer.setYAxisMax(Graph.MAX_HEIGHT_Y);
renderer.setAxesColor(Color.GRAY);
renderer.setLabelsColor(Color.LTGRAY);
renderer.setYLabelsAlign(Align.RIGHT);
renderer.setXLabels(20);
renderer.setYLabels(20);
renderer.setPanEnabled(true);
renderer.setZoomEnabled(true);
renderer.setShowGrid(true);
renderer.setXAxisBold(true);
renderer.setYAxisBold(true);
renderer.setZoomButtonsVisible(false);
renderer.setExternalZoomEnabled(true);
XYSeriesRenderer r = new XYSeriesRenderer();
r.setColor(context.getResources().getColor(R.color.graph_color));
r.setPointStyle(PointStyle.POINT);
r.setLineWidth(4f);
renderer.addSeriesRenderer(r);
return renderer;
}
示例5: LineGraphView
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
/**
* This constructor will set some properties of single chart and some properties of whole graph
*/
public LineGraphView() {
//add single line chart mSeries
mDataset.addSeries(mSeries);
//XYSeriesRenderer is used to set the properties like chart color, style of each point, etc. of single chart
final XYSeriesRenderer seriesRenderer = new XYSeriesRenderer();
//set line chart color to Black
seriesRenderer.setColor(Color.BLACK);
//set line chart style to square points
seriesRenderer.setPointStyle(PointStyle.SQUARE);
seriesRenderer.setFillPoints(true);
final XYMultipleSeriesRenderer renderer = mMultiRenderer;
//set whole graph background color to transparent color
renderer.setBackgroundColor(Color.TRANSPARENT);
renderer.setMargins(new int[] { 50, 65, 40, 5 }); // top, left, bottom, right
renderer.setMarginsColor(Color.argb(0x00, 0x01, 0x01, 0x01));
renderer.setAxesColor(Color.BLACK);
renderer.setAxisTitleTextSize(24);
renderer.setShowGrid(true);
renderer.setGridColor(Color.LTGRAY);
renderer.setLabelsColor(Color.BLACK);
renderer.setYLabelsColor(0, Color.DKGRAY);
renderer.setYLabelsAlign(Align.RIGHT);
renderer.setYLabelsPadding(4.0f);
renderer.setXLabelsColor(Color.DKGRAY);
renderer.setLabelsTextSize(20);
renderer.setLegendTextSize(20);
//Disable zoom
renderer.setPanEnabled(false, false);
renderer.setZoomEnabled(false, false);
//set title to x-axis and y-axis
renderer.setXTitle(" Time (seconds)");
renderer.setYTitle(" BPM");
renderer.addSeriesRenderer(seriesRenderer);
}
示例6: getChartRenderer
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
private XYMultipleSeriesRenderer getChartRenderer() {
XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
// TODO better style
float textSize = (float) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_SP, 12, getResources()
.getDisplayMetrics());
int marginSizeNormal = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_SP, 20, getResources()
.getDisplayMetrics());
int marginSizeLarge = (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_SP, 50, getResources()
.getDisplayMetrics());
renderer.setLabelsTextSize(textSize);
renderer.setYLabelsAngle(-30.0f);
renderer.setXLabelsAngle(-30.0f);
renderer.setXLabelsColor(Color.WHITE);
renderer.setYLabelsColor(0, Color.WHITE);
renderer.setXLabelsAlign(Align.RIGHT);
renderer.setYLabelsAlign(Align.RIGHT);
renderer.setLegendTextSize(textSize);
renderer.setFitLegend(true);
renderer.setMargins(new int[] { marginSizeNormal, marginSizeLarge,
marginSizeLarge, marginSizeNormal });
renderer.setPanEnabled(true, false);
renderer.setZoomEnabled(true, false);
renderer.setZoomButtonsVisible(false);
renderer.setApplyBackgroundColor(true);
renderer.setBackgroundColor(Color.DKGRAY);
renderer.setMarginsColor(Color.BLACK);
renderer.setGridColor(Color.WHITE);
renderer.setPointSize(8);
renderer.setShowGridY(true);
renderer.setClickEnabled(false);
renderer.setXLabels(6);
return renderer;
}
示例7: createGraph
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
protected void createGraph() {
graphRenderer = new XYMultipleSeriesRenderer();
graphRenderer.setChartTitle("Line Graph");
graphRenderer.setChartTitleTextSize(50);
graphRenderer.setMargins(new int[] {100, 100, 70, 50}); // top, left, bottom, right
graphRenderer.setBackgroundColor(Color.WHITE);
graphRenderer.setMarginsColor(Color.parseColor("#FFFFFF"));
graphRenderer.setAxesColor(Color.DKGRAY);
graphRenderer.setXTitle("Time(sec)");
graphRenderer.setYTitle("Value");
graphRenderer.setAxisTitleTextSize(30);
graphRenderer.setLabelsTextSize(25);
graphRenderer.setYLabelsAlign(Paint.Align.RIGHT);
// graphRenderer.setPointSize(50);
graphRenderer.setLegendTextSize(30);
graphRenderer.setXAxisMin(0);
graphRenderer.setXAxisMax(100);
graphRenderer.setZoomEnabled(false, false);
graphDataSerieses = new XYSeries[sensorInfo.getType().getValueNumbers()];
XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();;
for(int loop1 = 0 ; loop1 < sensorInfo.getType().getValueNumbers() ; loop1++) {
graphDataSerieses[loop1] = new TimeSeries(sensorInfo.getType().getValueInfos()[loop1][0] + "(" + sensorInfo.getType().getValueInfos()[loop1][1] + ")");
dataset.addSeries(graphDataSerieses[loop1]);
XYSeriesRenderer seriesRenderer = new XYSeriesRenderer();
seriesRenderer.setColor(Color.parseColor(COLORS[loop1]));
seriesRenderer.setPointStyle(PointStyle.POINT);
seriesRenderer.setLineWidth(3);
graphRenderer.addSeriesRenderer(seriesRenderer);
}
graphView = ChartFactory.getLineChartView(this, dataset, graphRenderer);
LinearLayout graphArea = (LinearLayout) findViewById(R.id.ll_graph_area);
graphArea.addView(graphView);
graphArea.setClickable(false);
}
示例8: renderGraph
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
public void renderGraph(Map<Long, Integer> scores){
removeAllViews();
String[] titles = new String[] { "" };
List<Date[]> dates = new ArrayList<Date[]>();
List<double[]> values = new ArrayList<double[]>();
int maxScore = 100;
Set<Long> keys = scores.keySet();
int i = keys.size() - 1;
if (0 > i){ return; }
Date[] dateValues = new Date[keys.size()];
double[] scoreValues = new double[keys.size()];
for (Long when : keys){
dateValues[i] = new Date(when);
int score = scores.get(when);
if (score > maxScore){ maxScore = score; }
scoreValues[i--] = score;
// store the last minimum date for later use by QamarGraphActivity
mMinimumDate = when;
}
dates.add(dateValues);
values.add(scoreValues);
int[] colors = new int[] { Color.BLUE };
PointStyle[] styles = new PointStyle[] { PointStyle.POINT };
XYMultipleSeriesRenderer renderer = buildRenderer(colors, styles);
setChartSettings(renderer, dateValues[0].getTime(),
dateValues[dateValues.length - 1].getTime(),
0, maxScore + 100, Color.DKGRAY);
renderer.setYLabels(10);
renderer.setPanEnabled(false, false);
renderer.setZoomEnabled(false, false);
View view = ChartFactory.getTimeChartView(mContext,
buildDateDataset(titles, dates, values),
renderer, "MMM yyyy");
addView(view, ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT);
}
示例9: buildRenderer
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
/**
* Build ECG Chart renderer.
* @return ecg chart renderer
*/
private XYMultipleSeriesRenderer buildRenderer() {
XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
for (int i = 0; i < DATA_COUNT; i++) {
XYSeriesRenderer r = new XYSeriesRenderer();
r.setColor(COLORS[i]);
r.setLineWidth(4f);
r.setPointStyle(PointStyle.CIRCLE);
r.setFillPoints(true);
r.setPointStrokeWidth(1f);
renderer.addSeriesRenderer(r);
}
renderer.setPointSize(1f);
renderer.setChartTitle("心電");
renderer.setChartTitleTextSize(CHART_TITLE_SIZE);
renderer.setXTitle("経過時間 [ms]");
renderer.setYTitle(" [μv]");
renderer.setLabelsTextSize(LABELS_SIZE);
renderer.setLabelsColor(TITLE_COLOR);
renderer.setXLabelsAlign(Paint.Align.LEFT);
renderer.setYLabelsAlign(Paint.Align.RIGHT);
renderer.setXLabelsColor(XLABEL_COLOR);
renderer.setYLabelsColor(0, YLABEL_COLOR);
renderer.setAxisTitleTextSize(AXIS_TITLE_SIZE);
renderer.setAxesColor(AXIS_COLOR);
renderer.setXAxisMin(mMinX);
renderer.setXAxisMax(mMaxX);
renderer.setYAxisMin(-3.0);
renderer.setYAxisMax(3.0);
renderer.setShowGridX(true);
renderer.setShowGridY(true);
renderer.setGridColor(GRID_COLOR);
renderer.setApplyBackgroundColor(true);
renderer.setBackgroundColor(Color.BLACK);
renderer.setMargins(new int[] {16, 48, 16, 8 });
renderer.setMarginsColor(Color.argb(0, 255, 255, 255));
renderer.setPanEnabled(false, false);
renderer.setShowLegend(true);
renderer.setLegendTextSize(15);
renderer.setFitLegend(false);
renderer.setZoomButtonsVisible(false);
renderer.setZoomEnabled(false, false);
return renderer;
}
示例10: buildRenderer
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
/**
* Build chart's renderer.
* @return chart renderer
*/
private XYMultipleSeriesRenderer buildRenderer() {
XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
for (int i = 0; i < DATA_COUNT; i++) {
XYSeriesRenderer r = new XYSeriesRenderer();
r.setColor(COLORS[i]);
r.setLineWidth(4f);
r.setPointStyle(PointStyle.CIRCLE);
r.setFillPoints(true);
r.setPointStrokeWidth(1f);
renderer.addSeriesRenderer(r);
}
renderer.setPointSize(1f);
renderer.setChartTitle("加速度");
renderer.setChartTitleTextSize(CHART_TITLE_SIZE);
renderer.setXTitle("経過時間 [ms]");
renderer.setYTitle(" [G]");
renderer.setLabelsTextSize(LABELS_SIZE);
renderer.setLabelsColor(TITLE_COLOR);
renderer.setXLabelsAlign(Paint.Align.LEFT);
renderer.setYLabelsAlign(Paint.Align.RIGHT);
renderer.setXLabelsColor(XLABEL_COLOR);
renderer.setYLabelsColor(0, YLABEL_COLOR);
renderer.setAxisTitleTextSize(AXIS_TITLE_SIZE);
renderer.setAxesColor(AXIS_COLOR);
renderer.setXAxisMin(mMinX);
renderer.setXAxisMax(mMaxX);
renderer.setYAxisMin(-3.0);
renderer.setYAxisMax(3.0);
renderer.setShowGridX(true);
renderer.setShowGridY(true);
renderer.setGridColor(GRID_COLOR);
renderer.setApplyBackgroundColor(true);
renderer.setBackgroundColor(Color.WHITE);
renderer.setMargins(new int[] {16, 48, 16, 8 });
renderer.setMarginsColor(Color.argb(0, 255, 255, 255));
renderer.setPanEnabled(false, false);
renderer.setShowLegend(true);
renderer.setLegendTextSize(15);
renderer.setFitLegend(false);
renderer.setZoomButtonsVisible(false);
renderer.setZoomEnabled(false, false);
return renderer;
}
開發者ID:DeviceConnect,項目名稱:DeviceConnect-Android,代碼行數:62,代碼來源:HitoeProfileDeviceOrientationFragment.java
示例11: getRenderer
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
/**
* Create graph renderer
*
* @return renderer object
*/
public XYMultipleSeriesRenderer getRenderer() {
XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
// set minimum for y axis to 0
renderer.setYAxisMin(-20);
renderer.setYAxisMax(+100);
// scrolling enabled
// renderer.setPanEnabled(true, false);
renderer.setPanEnabled(true, true);
// limits for scrolling (minx, maxx, miny, maxy)
// zoom buttons (in, out, 1:1)
renderer.setZoomButtonsVisible(true);
// enable zoom
// renderer.setZoomEnabled(true, false);
renderer.setZoomEnabled(true, true);
// set labels text size
renderer.setLabelsTextSize(30f);
renderer.setYLabelsAlign(Paint.Align.RIGHT);
renderer.setAxisTitleTextSize(30f);
renderer.setYTitle("Temperature [°C]");
// hide legend
// renderer.setShowLegend(false);
renderer.setShowLegend(true);
renderer.setLegendTextSize(30f);
renderer.setLegendHeight(130);
// set margins
// renderer.setMargins(new int[] {20, 30, 15, 0});
renderer.setMargins(new int[] {30, 70, 50, 0});
// renderer.setApplyBackgroundColor(true);
// renderer.setBackgroundColor(Color.WHITE);
// renderer.setMarginsColor(Color.WHITE);
renderer.setMarginsColor(Color.argb(0x00, 0x01, 0x01, 0x01));
// todo: need to get background colour of activity, transparent is not good enough
// renderer.setMarginsColor(((ColorDrawable) _layGraph.getBackground()).getColor());
renderer.setXAxisMin(new Date().getTime() - 30 * 60 * 1000);
renderer.setZoomButtonsVisible(false);
renderer.setExternalZoomEnabled(true);
// XYSeriesRenderer r = new XYSeriesRenderer();
// set color
// r.setColor(Color.GREEN);
// set fill below line
// r.setFillBelowLine(true);
// renderer.addSeriesRenderer(r);
return renderer;
}
示例12: setUpRenderer
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
private void setUpRenderer(Activity activity) {
// Now we create the renderer
XYSeriesRenderer mCurrentRenderer = new XYSeriesRenderer();
mCurrentRenderer.setLineWidth(getDPI(2));
mCurrentRenderer.setColor(activity.getResources().getColor(R.color.colorBarGraph));
// Include low and max value
mCurrentRenderer.setDisplayBoundingPoints(true);
// we add point markers
mCurrentRenderer.setPointStyle(PointStyle.CIRCLE);
mCurrentRenderer.setPointStrokeWidth(getDPI(5));
mCurrentRenderer.setShowLegendItem(false);
// Creating XYSeriesRenderer to customize expenseSeries
XYSeriesRenderer expenseRenderer = new XYSeriesRenderer();
expenseRenderer.setColor(activity.getResources().getColor(R.color.colorBarGraph2));
expenseRenderer.setPointStyle(PointStyle.POINT);
expenseRenderer.setFillPoints(true);
expenseRenderer.setLineWidth(getDPI(3));
expenseRenderer.setShowLegendItem(false);
mRenderer = new XYMultipleSeriesRenderer();
mRenderer.addSeriesRenderer(mCurrentRenderer);
mRenderer.addSeriesRenderer(expenseRenderer);
// We want to avoid black border
mRenderer.setMarginsColor(Color.argb(0x00, 0xff, 0x00, 0x00)); // transparent margins
// Disable Pan on two axis
mRenderer.setPanEnabled(true, false);
mRenderer.setZoomEnabled(true, false);
mRenderer.setLabelsTextSize(getDPI(15));
mRenderer.setXLabelsColor(activity.getResources().getColor(R.color.colorWhite));
mRenderer.setYLabelsColor(0, activity.getResources().getColor(R.color.colorWhite));
mRenderer.setLabelsColor(activity.getResources().getColor(R.color.colorWhite));
mRenderer.setAxesColor(activity.getResources().getColor(R.color.colorWhite));
mRenderer.setBarSpacing(0.2);
mRenderer.setShowGrid(true); // we show the grid
mRenderer.setXLabels(0);
// enable the chart click events
mRenderer.setClickEnabled(true);
mRenderer.setSelectableBuffer(10);
}