本文整理匯總了Java中org.achartengine.renderer.XYMultipleSeriesRenderer類的典型用法代碼示例。如果您正苦於以下問題:Java XYMultipleSeriesRenderer類的具體用法?Java XYMultipleSeriesRenderer怎麽用?Java XYMultipleSeriesRenderer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
XYMultipleSeriesRenderer類屬於org.achartengine.renderer包,在下文中一共展示了XYMultipleSeriesRenderer類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getCombinedXYChartIntent
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入依賴的package包/類
/**
* Creates a combined XY chart intent that can be used to start the graphical
* view activity.
*
* @param context the context
* @param dataset the multiple series dataset (cannot be null)
* @param renderer the multiple series renderer (cannot be null)
* @param types the chart types (cannot be null)
* @param activityTitle the graphical chart activity title
* @return a combined XY chart intent
* @throws IllegalArgumentException if dataset is null or renderer is null or
* if a dataset number of items is different than the number of
* series renderers or number of chart types
*/
public static final Intent getCombinedXYChartIntent(Context context,
XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, String[] types,
String activityTitle) {
if (dataset == null || renderer == null || types == null
|| dataset.getSeriesCount() != types.length) {
throw new IllegalArgumentException(
"Datasets, renderers and types should be not null and the datasets series count should be equal to the types length");
}
checkParameters(dataset, renderer);
Intent intent = new Intent(context, GraphicalActivity.class);
CombinedXYChart chart = new CombinedXYChart(dataset, renderer, types);
intent.putExtra(CHART, chart);
intent.putExtra(TITLE, activityTitle);
return intent;
}
示例2: 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);
}
示例3: DataSetManager
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入依賴的package包/類
public DataSetManager(int numberOfTabs, int numberOfConstellations,
Context context, ColorMap colorMap) {
mDataSetList = new ArrayList[numberOfTabs];
mRendererList = new ArrayList[numberOfTabs];
mSatelliteIndex = new ArrayList[numberOfTabs];
mSatelliteConstellationIndex = new ArrayList[numberOfTabs];
mContext = context;
mColorMap = colorMap;
// Preparing data sets and renderer for all six constellations
for (int i = 0; i < numberOfTabs; i++) {
mDataSetList[i] = new ArrayList<>();
mRendererList[i] = new ArrayList<>();
mSatelliteIndex[i] = new ArrayList<>();
mSatelliteConstellationIndex[i] = new ArrayList<>();
for (int k = 0; k <= numberOfConstellations; k++) {
mSatelliteIndex[i].add(new ArrayMap<Integer, Integer>());
mSatelliteConstellationIndex[i].add(new ArrayMap<Integer, Integer>());
XYMultipleSeriesRenderer tempRenderer = new XYMultipleSeriesRenderer();
setUpRenderer(tempRenderer, i);
mRendererList[i].add(tempRenderer);
XYMultipleSeriesDataset tempDataSet = new XYMultipleSeriesDataset();
mDataSetList[i].add(tempDataSet);
}
}
}
示例4: 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);
}
示例5: 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;
}
示例6: onListItemClick
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入依賴的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;
}
}
示例7: setRenderer
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入依賴的package包/類
protected void setRenderer(XYMultipleSeriesRenderer renderer, int[] colors,
PointStyle[] styles) {
renderer.setAxisTitleTextSize(16);
renderer.setChartTitleTextSize(20);
renderer.setLabelsTextSize(15);
renderer.setLegendTextSize(15);
renderer.setPointSize(5f);
renderer.setMargins(new int[] { 20, 30, 15, 20 });
int length = colors.length;
for (int i = 0; i < length; i++) {
XYSeriesRenderer r = new XYSeriesRenderer();
r.setColor(colors[i]);
r.setPointStyle(styles[i]);
renderer.addSeriesRenderer(r);
}
}
示例8: CombinedXYChart
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入依賴的package包/類
/**
* Builds a new combined XY chart instance.
*
* @param dataset the multiple series dataset
* @param renderer the multiple series renderer
* @param types the XY chart types
*/
public CombinedXYChart(XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer,
String[] types) {
super(dataset, renderer);
int length = types.length;
mCharts = new XYChart[length];
for (int i = 0; i < length; i++) {
try {
mCharts[i] = getXYChart(types[i]);
} catch (Exception e) {
// ignore
}
if (mCharts[i] == null) {
throw new IllegalArgumentException("Unknown chart type " + types[i]);
} else {
XYMultipleSeriesDataset newDataset = new XYMultipleSeriesDataset();
newDataset.addSeries(dataset.getSeriesAt(i));
XYMultipleSeriesRenderer newRenderer = new XYMultipleSeriesRenderer();
// TODO: copy other parameters here
newRenderer.setBarSpacing(renderer.getBarSpacing());
newRenderer.setPointSize(renderer.getPointSize());
int scale = dataset.getSeriesAt(i).getScaleNumber();
if (renderer.isMinXSet(scale)) {
newRenderer.setXAxisMin(renderer.getXAxisMin(scale));
}
if (renderer.isMaxXSet(scale)) {
newRenderer.setXAxisMax(renderer.getXAxisMax(scale));
}
if (renderer.isMinYSet(scale)) {
newRenderer.setYAxisMin(renderer.getYAxisMin(scale));
}
if (renderer.isMaxYSet(scale)) {
newRenderer.setYAxisMax(renderer.getYAxisMax(scale));
}
newRenderer.addSeriesRenderer(renderer.getSeriesRendererAt(i));
mCharts[i].setDatasetRenderer(newDataset, newRenderer);
}
}
}
示例9: 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;
}
示例10: 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);
}
示例11: buildRenderer
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入依賴的package包/類
protected XYMultipleSeriesRenderer buildRenderer(int color, PointStyle style, boolean fill) {
XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
//設置圖表中曲線本身的樣式,包括顏色、點的大小以及線的粗細等
XYSeriesRenderer r = new XYSeriesRenderer();
r.setColor(Color.RED);
// r.setPointStyle(null);
// r.setFillPoints(fill);
r.setLineWidth(1);
renderer.addSeriesRenderer(r);
return renderer;
}
示例12: addValue
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入依賴的package包/類
/**
* Adds a value into the both the data set containing all constellations and individual data set
* of the constellation of the satellite
*/
private void addValue(int tab, int constellationType, int svID,
double timeInSeconds, double value) {
XYMultipleSeriesDataset dataSetAll = getDataSet(tab, DATA_SET_INDEX_ALL);
XYMultipleSeriesRenderer rendererAll = getRenderer(tab, DATA_SET_INDEX_ALL);
value = Double.parseDouble(sDataFormat.format(value));
if (hasSeen(constellationType, svID, tab)) {
// If the satellite has been seen before, we retrieve the dataseries it is add and add new
// data
dataSetAll
.getSeriesAt(mSatelliteIndex[tab].get(constellationType).get(svID))
.add(timeInSeconds, value);
mDataSetList[tab]
.get(constellationType)
.getSeriesAt(mSatelliteConstellationIndex[tab].get(constellationType).get(svID))
.add(timeInSeconds, value);
} else {
// If the satellite has not been seen before, we create new dataset and renderer before
// adding data
mSatelliteIndex[tab].get(constellationType).put(svID, dataSetAll.getSeriesCount());
mSatelliteConstellationIndex[tab]
.get(constellationType)
.put(svID, mDataSetList[tab].get(constellationType).getSeriesCount());
XYSeries tempSeries = new XYSeries(CONSTELLATION_PREFIX[constellationType - 1] + svID);
tempSeries.add(timeInSeconds, value);
dataSetAll.addSeries(tempSeries);
mDataSetList[tab].get(constellationType).addSeries(tempSeries);
XYSeriesRenderer tempRenderer = new XYSeriesRenderer();
tempRenderer.setLineWidth(5);
tempRenderer.setColor(mColorMap.getColor(svID, constellationType));
rendererAll.addSeriesRenderer(tempRenderer);
mRendererList[tab].get(constellationType).addSeriesRenderer(tempRenderer);
}
}
示例13: setRenderer
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入依賴的package包/類
private void setRenderer(XYMultipleSeriesRenderer renderer, int[] colors, PointStyle[] styles) {
renderer.setAxisTitleTextSize(16);
renderer.setChartTitleTextSize(20);
renderer.setLabelsTextSize(15);
renderer.setLegendTextSize(15);
renderer.setPointSize(5f);
renderer.setMargins(new int[] { 20, 30, 15, 20 });
int length = colors.length;
for (int i = 0; i < length; i++) {
XYSeriesRenderer r = new XYSeriesRenderer();
r.setColor(colors[i]);
r.setPointStyle(styles[i]);
renderer.addSeriesRenderer(r);
}
}
示例14: 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 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
*/
protected void setChartSettings(XYMultipleSeriesRenderer renderer,
double xMin, double xMax, double yMin,
double yMax, int axesColor) {
renderer.setXAxisMin(xMin);
renderer.setXAxisMax(xMax);
renderer.setYAxisMin(yMin);
renderer.setYAxisMax(yMax);
renderer.setAxesColor(axesColor);
renderer.setShowLabels(false);
renderer.setShowLegend(false);
renderer.setMarginsColor(Color.WHITE);
}
示例15: getCombinedXYChartIntent
import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入依賴的package包/類
public static final Intent getCombinedXYChartIntent(Context context, XYMultipleSeriesDataset xymultipleseriesdataset, XYMultipleSeriesRenderer xymultipleseriesrenderer, String as[], String s)
{
if (xymultipleseriesdataset == null || xymultipleseriesrenderer == null || as == null || xymultipleseriesdataset.getSeriesCount() != as.length)
{
throw new IllegalArgumentException("Datasets, renderers and types should be not null and the datasets series count should be equal to the types length");
} else
{
a(xymultipleseriesdataset, xymultipleseriesrenderer);
Intent intent = new Intent(context, org/achartengine/GraphicalActivity);
intent.putExtra("chart", new CombinedXYChart(xymultipleseriesdataset, xymultipleseriesrenderer, as));
intent.putExtra("title", s);
return intent;
}
}