本文整理汇总了Java中org.achartengine.renderer.XYSeriesRenderer.setColor方法的典型用法代码示例。如果您正苦于以下问题:Java XYSeriesRenderer.setColor方法的具体用法?Java XYSeriesRenderer.setColor怎么用?Java XYSeriesRenderer.setColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.achartengine.renderer.XYSeriesRenderer
的用法示例。
在下文中一共展示了XYSeriesRenderer.setColor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderGraph
import org.achartengine.renderer.XYSeriesRenderer; //导入方法依赖的package包/类
private void renderGraph() {
mSeries = new XYSeries("Vols/FreqBin");
div10 = new XYSeries("div10");
mSeries.add(3,4);
mRenderer = new XYSeriesRenderer();
div10Renderer = new XYSeriesRenderer();
div10Renderer.setColor(root.getResources().getColor(R.color.red));
dataset.addSeries(mSeries);
dataset.addSeries(div10);
renderer.addSeriesRenderer(mRenderer);
renderer.addSeriesRenderer(div10Renderer);
renderer.setPanEnabled(false);
renderer.setZoomEnabled(false);
mChart = ChartFactory.getLineChartView(getActivity(), dataset, renderer);
((LinearLayout)root.findViewById(R.id.chart)).addView(mChart);
}
示例2: addAlertSeries
import org.achartengine.renderer.XYSeriesRenderer; //导入方法依赖的package包/类
private void addAlertSeries() {
TimeSeries alertSeries = new TimeSeries("Alerts");
long alertTime = _maxTime - 5000 * 60;
alertSeries.add(alertTime, Long.MAX_VALUE);
alertSeries.add(alertTime, Long.MIN_VALUE);
_dataSet.addSeries(alertSeries);
// create new renderer for the new series
XYSeriesRenderer renderer = new XYSeriesRenderer();
_multipleSeriesRenderer.addSeriesRenderer(renderer);
renderer.setPointStyle(PointStyle.POINT);
renderer.setColor(Color.RED);
renderer.setFillPoints(false);
renderer.setDisplayChartValues(false);
// renderer.setDisplayChartValuesDistance(1);
// renderer.setChartValuesTextSize(30f);
renderer.setShowLegendItem(false);
}
示例3: addRenderer
import org.achartengine.renderer.XYSeriesRenderer; //导入方法依赖的package包/类
@Override
public void addRenderer(int series, Activity activity, int color) {
XYSeriesRenderer mCurrentRenderer = new XYSeriesRenderer();
mCurrentRenderer.setLineWidth(getDPI(3));
mCurrentRenderer.setColor(color);
// Include low and max value
mCurrentRenderer.setDisplayBoundingPoints(true);
// we add point markers
mCurrentRenderer.setPointStyle(PointStyle.CIRCLE);
mCurrentRenderer.setPointStrokeWidth(getDPI(5));
mCurrentRenderer.setShowLegendItem(false);
XYSeries seriesData = new XYSeries("data" + series);
mSeriesDataSet.add(series, seriesData);
mRenderer.addSeriesRenderer(series, mCurrentRenderer);
}
示例4: setRenderer
import org.achartengine.renderer.XYSeriesRenderer; //导入方法依赖的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);
}
}
示例5: getDemoRenderer
import org.achartengine.renderer.XYSeriesRenderer; //导入方法依赖的package包/类
private XYMultipleSeriesRenderer getDemoRenderer() {
XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
renderer.setAxisTitleTextSize(HeartRateMonitor.CHART_AXIS_TITLE_SIZE);
renderer.setChartTitleTextSize(HeartRateMonitor.CHART_TITLE_SIZE);
renderer.setLabelsTextSize(HeartRateMonitor.CHART_LABELS_TEXT_SIZE);
renderer.setLegendTextSize(HeartRateMonitor.CHART_LEGEND_TEXT_SIZE);
renderer.setPointSize(HeartRateMonitor.CHART_POINT_SIZE);
renderer.setMarginsColor(Color.WHITE);
renderer.setMargins(new int[]{20, 20, 15, 0});
XYSeriesRenderer r = new XYSeriesRenderer();
r.setColor(Color.RED);
r.setPointStyle(PointStyle.SQUARE);
r.setFillBelowLine(true);
r.setFillBelowLineColor(Color.WHITE);
r.setFillPoints(true);
renderer.addSeriesRenderer(r);
return renderer;
}
示例6: getDemoRenderer
import org.achartengine.renderer.XYSeriesRenderer; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
private XYMultipleSeriesRenderer getDemoRenderer() {
XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
renderer.setAxisTitleTextSize(HeartRateMonitor.CHART_AXIS_TITLE_SIZE);
renderer.setChartTitleTextSize(HeartRateMonitor.CHART_TITLE_SIZE);
renderer.setLabelsTextSize(HeartRateMonitor.CHART_LABELS_TEXT_SIZE);
renderer.setLegendTextSize(HeartRateMonitor.CHART_LEGEND_TEXT_SIZE);
renderer.setPointSize(HeartRateMonitor.CHART_POINT_SIZE);
renderer.setMarginsColor(Color.WHITE);
renderer.setMargins(new int[]{20, 30, 15, 0});
XYSeriesRenderer r = new XYSeriesRenderer();
r.setColor(Color.BLUE);
r.setPointStyle(PointStyle.SQUARE);
r.setFillBelowLine(true);
r.setFillBelowLineColor(Color.WHITE);
r.setFillPoints(true);
renderer.addSeriesRenderer(r);
return renderer;
}
示例7: getRenderer
import org.achartengine.renderer.XYSeriesRenderer; //导入方法依赖的package包/类
public XYMultipleSeriesRenderer getRenderer() {
// 新建一个xymultipleseries
render = new XYMultipleSeriesRenderer();
render.setAxisTitleTextSize(16); // 设置坐标轴标题文本大小
render.setChartTitleTextSize(20); // 设置图表标题文本大小
render.setLabelsTextSize(15); // 设置轴标签文本大小
render.setLegendTextSize(15); // 设置图例文本大小
render.setMargins(new int[] {20, 30, 15,0}); // 设置4边留白
render.setPanEnabled(false, false); // 设置x,y坐标轴不会因用户划动屏幕而移动
// 设置4边留白透明
render.setMarginsColor(Color.argb(0,0xff, 0, 0));
render.setBackgroundColor(Color.TRANSPARENT); // 设置背景色透明
render.setApplyBackgroundColor(true); // 使背景色生效
render.setXTitle("持续时间");
render.setYTitle("海拔高度");
// 设置一个系列的颜色为蓝色
xyRender = new XYSeriesRenderer();
xyRender.setColor(Color.BLUE);
// 往xymultiplerender中增加一个系列
render.addSeriesRenderer(xyRender);
return render;
}
示例8: buildRenderer
import org.achartengine.renderer.XYSeriesRenderer; //导入方法依赖的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;
}
示例9: LineGraphView
import org.achartengine.renderer.XYSeriesRenderer; //导入方法依赖的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);
}
示例10: getReportRenderer
import org.achartengine.renderer.XYSeriesRenderer; //导入方法依赖的package包/类
private XYSeriesRenderer getReportRenderer(int color) {
int displayChartValueDistance = 40;
int lineWidth = 3;
XYSeriesRenderer reportRenderer = new XYSeriesRenderer();
reportRenderer.setPointStyle(PointStyle.CIRCLE);
reportRenderer.setFillPoints(true);
reportRenderer.setColor(color);
reportRenderer.setLineWidth(lineWidth);
reportRenderer.setDisplayChartValues(true);
reportRenderer.setDisplayChartValuesDistance(displayChartValueDistance);
return reportRenderer;
}
示例11: buildRenderer
import org.achartengine.renderer.XYSeriesRenderer; //导入方法依赖的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.XYSeriesRenderer; //导入方法依赖的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.XYSeriesRenderer; //导入方法依赖的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: addSeries
import org.achartengine.renderer.XYSeriesRenderer; //导入方法依赖的package包/类
/**
* Add a graph for the data in 'series' with 'color' to the plot.
* @param series The x and y values to add
* @param color Used for plotting
*/
public void addSeries(XYSeries series, int color) {
dataset.addSeries(series);
XYSeriesRenderer renderer = new XYSeriesRenderer();
renderer.setColor(color);
plotRenderer.addSeriesRenderer(renderer);
}
示例15: addDummySeries
import org.achartengine.renderer.XYSeriesRenderer; //导入方法依赖的package包/类
/**
* Add a dummy series with a single, transparent point in the origin to the plot.
*/
protected void addDummySeries() {
XYSeries series = new XYSeries("dummy");
series.add(0, 0);
dataset.addSeries(series);
XYSeriesRenderer renderer = new XYSeriesRenderer();
renderer.setColor(Color.TRANSPARENT);
plotRenderer.addSeriesRenderer(renderer);
}