本文整理匯總了Java中org.achartengine.renderer.XYMultipleSeriesRenderer.setXTitle方法的典型用法代碼示例。如果您正苦於以下問題:Java XYMultipleSeriesRenderer.setXTitle方法的具體用法?Java XYMultipleSeriesRenderer.setXTitle怎麽用?Java XYMultipleSeriesRenderer.setXTitle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.achartengine.renderer.XYMultipleSeriesRenderer
的用法示例。
在下文中一共展示了XYMultipleSeriesRenderer.setXTitle方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setChartSettings
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
protected void setChartSettings(XYMultipleSeriesRenderer renderer, String xTitle, String yTitle,
double xMin, double xMax, double yMin, double yMax, int axesColor, int labelsColor) {
//有關對圖表的渲染可參看api文檔
renderer.setChartTitle(mTitle);
renderer.setXTitle(xTitle);
renderer.setYTitle(yTitle);
renderer.setXAxisMin(xMin);
renderer.setXAxisMax(xMax);
renderer.setYAxisMin(yMin);
renderer.setYAxisMax(yMax);
renderer.setAxesColor(axesColor);
renderer.setLabelsColor(labelsColor);
renderer.setShowGrid(true);
renderer.setGridColor(Color.GREEN);
renderer.setXLabels(20);
renderer.setYLabels(10);
renderer.setXTitle("Time");
renderer.setYTitle(" ");
renderer.setYLabelsAlign(Paint.Align.RIGHT);
renderer.setPointSize((float) 3);
renderer.setShowLegend(false);
}
示例2: customizeMultipleRender
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
protected XYMultipleSeriesRenderer customizeMultipleRender(){
// Creating a XYMultipleSeriesRenderer to customize the whole chart
XYMultipleSeriesRenderer rendererT = new XYMultipleSeriesRenderer();
rendererT.setXLabels(0);
rendererT.setBackgroundColor(Color.BLACK);
rendererT.setAxesColor(Color.WHITE);
rendererT.setGridColor(Color.WHITE);
rendererT.setShowGrid(true);
rendererT.setApplyBackgroundColor(true);
rendererT.setXTitle("Index");
rendererT.setYTitle("Rebuffering ratio (%)");
// Changing font size and point size
rendererT.setAxisTitleTextSize(26);
rendererT.setLabelsTextSize(22);
rendererT.setLegendTextSize(26);
rendererT.setLegendHeight(80);
rendererT.setPointSize(8);
// Setting margins: above, left, below, right
rendererT.setMargins(new int[] {0, 70, 100, 50});
return rendererT;
}
示例3: 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;
}
示例4: 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);
}
示例5: setChartSettings
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
private void setChartSettings(XYMultipleSeriesRenderer renderer) {
renderer.setChartTitle("Chart demo");
renderer.setXTitle("x values");
renderer.setYTitle("y values");
renderer.setXAxisMin(0.5);
renderer.setXAxisMax(10.5);
renderer.setYAxisMin(0);
renderer.setYAxisMax(210);
}
示例6: customizeMultipleRender
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
protected XYMultipleSeriesRenderer customizeMultipleRender(){
// Creating a XYMultipleSeriesRenderer to customize the whole chart
XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
renderer.setXLabels(0);
renderer.setBackgroundColor(Color.BLACK);
renderer.setAxesColor(Color.WHITE);
renderer.setGridColor(Color.WHITE);
renderer.setShowGrid(true);
renderer.setApplyBackgroundColor(true);
renderer.setXTitle("Month");
renderer.setYTitle("Avg. rebuffering ratio (%)");
// Changing font size and point size
renderer.setAxisTitleTextSize(26);
renderer.setLabelsTextSize(22);
renderer.setLegendTextSize(26);
renderer.setLegendHeight(80);
renderer.setPointSize(8);
// Setting margins: above, left, below, right
renderer.setMargins(new int[] {0, 70, 100, 50});
for(int i=0;i < xlabel.length;i++){
renderer.addXTextLabel(i+1, mMonth[i]);
}
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: 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;
}
示例9: 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
示例10: draw
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
public void draw() {
ArrayList<String> dates;
ArrayList<Double> readings;
// assign the data passed to the intent
dates = getIntent().getStringArrayListExtra("dates");
readings = (ArrayList<Double>) getIntent().getSerializableExtra(
"readings");
title = getIntent().getStringExtra("test");
// create a new time series for the graph
TimeSeries series = new TimeSeries(title + " Results");
// populate the series with data retrieved from the database
for (int i = dates.size() - 1; i >= 0; i--) {
// parse the date object to calendar date time
try {
c.setTime(sdf.parse(dates.get(i)));
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// add the current point to the time series
series.add(c.getTime(), readings.get(i));
}
XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
dataset.addSeries(series); // initialize the set of data to be drawn
// Now create the renderer to control how the chart looks like
XYSeriesRenderer renderer = new XYSeriesRenderer();
renderer.setLineWidth(4);
renderer.setColor(Color.WHITE);
// add point markers
renderer.setPointStyle(PointStyle.CIRCLE);
renderer.setPointStrokeWidth(3);
renderer.setDisplayChartValues(true);
XYMultipleSeriesRenderer mRenderer = new XYMultipleSeriesRenderer();
mRenderer.addSeriesRenderer(renderer);
// avoid black border
mRenderer.setMarginsColor(Color.argb(0x00, 0xff, 0x00, 0x00)); // transparent
// margins
// Enable Pan on two axis
mRenderer.setPanEnabled(true, true);
mRenderer.setShowGrid(true); // show the grid
mRenderer.setXTitle("Day");
if (title.equals("HBA1C"))
mRenderer.setYTitle("%");
else
mRenderer.setYTitle("mg/dl");
mRenderer.setZoomButtonsVisible(true);
GraphicalView chartView = ChartFactory.getTimeChartView(DrawGraph.this,
dataset, mRenderer, "yyyy/MM/dd hh:mm aa");// combines the dataset with
// the renderer and returns
// a view
LinearLayout chart_container = (LinearLayout) findViewById(R.id.Chart_layout);
//set the created chart view to the linear layout of the layout created for the graph
chart_container.addView(chartView, 0);
}
示例11: onCreate
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
// keep main display on?
if(MainActivity.prefs.getBoolean("keep_screen_on", false))
{
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}
// prevent activity from falling asleep
PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE);
wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
getString(R.string.app_name));
wakeLock.acquire();
// set up action bar
ActionBar actionBar = getActionBar();
if (actionBar != null)
{
actionBar.setDisplayShowTitleEnabled(true);
}
setTitle(R.string.chart);
/* get PIDs to be shown */
int positions[] = getIntent().getIntArrayExtra(POSITIONS);
// set up overall chart properties
sensorData = new XYMultipleSeriesDataset();
renderer = new XYMultipleSeriesRenderer(positions.length);
chartView = ChartFactory.getTimeChartView(this, sensorData, renderer, "H:mm:ss");
// set up global renderer
renderer.setXTitle(getString(R.string.time));
renderer.setXLabels(5);
renderer.setYLabels(5);
renderer.setGridColor(Color.DKGRAY);
renderer.setShowGrid(true);
renderer.setFitLegend(true);
renderer.setClickEnabled(false);
// set up chart data
setUpChartData(positions);
// make chart visible
setContentView(chartView);
// limit selected PIDs to selection
MainActivity.setFixedPids(pidNumbers);
// if auto hiding selected ...
if(MainActivity.prefs.getBoolean(MainActivity.PREF_AUTOHIDE,false))
{
// get autohide timeout [s]
int timeout = Integer.valueOf(
MainActivity.prefs.getString(MainActivity.PREF_AUTOHIDE_DELAY,"15") );
// auto hide toolbar
toolBarHider = new AutoHider( this,
mHandler,
MainActivity.MESSAGE_TOOLBAR_VISIBLE,
timeout * 1000);
toolBarHider.start(1000);
// wake up on touch
chartView.setOnTouchListener(toolBarHider);
}
}
示例12: setChartSettings
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
/**
* Sets a few of the series renderer settings.
*
* @param renderer the renderer to set the properties to
* @param title the chart title
* @param xTitle the title for the X axis
* @param yTitle the title for the Y axis
* @param xMin the minimum value on the X axis
* @param xMax the maximum value on the X axis
* @param yMin the minimum value on the Y axis
* @param yMax the maximum value on the Y axis
* @param axesColor the axes color
* @param labelsColor the labels color
*/
protected void setChartSettings(XYMultipleSeriesRenderer renderer, String title, String xTitle,
String yTitle, double xMin, double xMax, double yMin, double yMax, int axesColor,
int labelsColor) {
renderer.setChartTitle(title);
renderer.setXTitle(xTitle);
renderer.setYTitle(yTitle);
renderer.setXAxisMin(xMin);
renderer.setXAxisMax(xMax);
renderer.setYAxisMin(yMin);
renderer.setYAxisMax(yMax);
renderer.setAxesColor(axesColor);
renderer.setLabelsColor(labelsColor);
}
示例13: setChartSettings
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
/**
* Sets a few of the series renderer settings.
*
* @param renderer
* the renderer to set the properties to
* @param title
* the chart title
* @param xTitle
* the title for the X axis
* @param yTitle
* the title for the Y axis
* @param xMin
* the minimum value on the X axis
* @param xMax
* the maximum value on the X axis
* @param yMin
* the minimum value on the Y axis
* @param yMax
* the maximum value on the Y axis
* @param axesColor
* the axes color
* @param labelsColor
* the labels color
*/
protected void setChartSettings(XYMultipleSeriesRenderer renderer,
String title, String xTitle, String yTitle, double xMin,
double xMax, double yMin, double yMax, int axesColor,
int labelsColor) {
renderer.setChartTitle(title);
renderer.setXTitle(xTitle);
renderer.setYTitle(yTitle);
renderer.setXAxisMin(xMin);
renderer.setXAxisMax(xMax);
renderer.setYAxisMin(yMin);
renderer.setYAxisMax(yMax);
renderer.setAxesColor(axesColor);
renderer.setLabelsColor(labelsColor);
}