本文整理匯總了Java中org.achartengine.renderer.XYSeriesRenderer.setPointStrokeWidth方法的典型用法代碼示例。如果您正苦於以下問題:Java XYSeriesRenderer.setPointStrokeWidth方法的具體用法?Java XYSeriesRenderer.setPointStrokeWidth怎麽用?Java XYSeriesRenderer.setPointStrokeWidth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.achartengine.renderer.XYSeriesRenderer
的用法示例。
在下文中一共展示了XYSeriesRenderer.setPointStrokeWidth方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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);
}
示例2: execute
import org.achartengine.renderer.XYSeriesRenderer; //導入方法依賴的package包/類
/**
* Executes the chart demo.
*
* @param context the context
* @return the built intent
*/
public Intent execute(Context context) {
String[] titles = new String[] { "Sales growth January 1995 to December 2000" };
List<Date[]> dates = new ArrayList<Date[]>();
List<double[]> values = new ArrayList<double[]>();
Date[] dateValues = new Date[] { new Date(95, 0, 1), new Date(95, 3, 1), new Date(95, 6, 1),
new Date(95, 9, 1), new Date(96, 0, 1), new Date(96, 3, 1), new Date(96, 6, 1),
new Date(96, 9, 1), new Date(97, 0, 1), new Date(97, 3, 1), new Date(97, 6, 1),
new Date(97, 9, 1), new Date(98, 0, 1), new Date(98, 3, 1), new Date(98, 6, 1),
new Date(98, 9, 1), new Date(99, 0, 1), new Date(99, 3, 1), new Date(99, 6, 1),
new Date(99, 9, 1), new Date(100, 0, 1), new Date(100, 3, 1), new Date(100, 6, 1),
new Date(100, 9, 1), new Date(100, 11, 1) };
dates.add(dateValues);
values.add(new double[] { 4.9, 5.3, 3.2, 4.5, 6.5, 4.7, 5.8, 4.3, 4, 2.3, -0.5, -2.9, 3.2, 5.5,
4.6, 9.4, 4.3, 1.2, 0, 0.4, 4.5, 3.4, 4.5, 4.3, 4 });
int[] colors = new int[] { Color.BLUE };
PointStyle[] styles = new PointStyle[] { PointStyle.POINT };
XYMultipleSeriesRenderer renderer = buildRenderer(colors, styles);
setChartSettings(renderer, "Sales growth", "Date", "%", dateValues[0].getTime(),
dateValues[dateValues.length - 1].getTime(), -4, 11, Color.GRAY, Color.LTGRAY);
renderer.setYLabels(10);
renderer.setXLabelMinimumDistance(3. * 30. * 24. * 60. * 60. * 1000.);
renderer.setYLabelMinimumDistance(0.01, 0);
renderer.setXZoomMax(3. * 30. * 24. * 60. * 60. * 1000.);
XYSeriesRenderer xyRenderer = (XYSeriesRenderer) renderer.getSeriesRendererAt(0);
FillOutsideLine f = FillOutsideLine.BELOW;
f.setGradient(true);
f.setColor(0x80000000);
f.setColor2(0xff0000ff);
xyRenderer.addFillOutsideLine(f);
xyRenderer.setPointStyle(PointStyle.CIRCLE);
xyRenderer.setPointStrokeWidth(3);
return ChartFactory.getTimeChartIntent(context, buildDateDataset(titles, dates, values),
renderer, "MMM yyyy");
}
示例3: buildRenderer
import org.achartengine.renderer.XYSeriesRenderer; //導入方法依賴的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;
}
示例4: buildRenderer
import org.achartengine.renderer.XYSeriesRenderer; //導入方法依賴的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
示例5: draw
import org.achartengine.renderer.XYSeriesRenderer; //導入方法依賴的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);
}
示例6: setUpRenderer
import org.achartengine.renderer.XYSeriesRenderer; //導入方法依賴的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);
}
示例7: setTimeChart
import org.achartengine.renderer.XYSeriesRenderer; //導入方法依賴的package包/類
private void setTimeChart(Set<Vote> votes) {
if (votes.size() != 0)
{
double[] dubble = createArrayOfVotes(votes);
XYSeriesRenderer renderer = new XYSeriesRenderer();
renderer.setLineWidth(2);
renderer.setColor(Color.parseColor("#FF9912"));
// Include low and max value
renderer.setDisplayBoundingPoints(true);
// we add point markers
renderer.setPointStyle(PointStyle.CIRCLE);
renderer.setPointStrokeWidth(3);
renderer.setFillPoints(true);
// renderer.setFillBelowLine(true);
// renderer.setFillBelowLineColor(Color.parseColor("#FF9912"));
XYSeries series = new XYSeries("Votes");
for (int i = 0; i < dubble.length; i++)
{
series.add(i, dubble[i]);
}
XYMultipleSeriesDataset dataSet = new XYMultipleSeriesDataset();
dataSet.addSeries(series);
XYMultipleSeriesRenderer multiRenderer = new XYMultipleSeriesRenderer();
multiRenderer.setAxisTitleTextSize(22);
multiRenderer.setChartTitleTextSize(22);
multiRenderer.setLabelsTextSize(22);
multiRenderer.setYLabelsAlign(Align.LEFT);
multiRenderer.setXTitle(getString(R.string.time_in_seconds));
multiRenderer.setYTitle(getString(R.string.number_of_votes));
// Avoid black border
multiRenderer.setMarginsColor(Color.argb(0x00, 0xff, 0x00, 0x00)); // transparent
// margins
// Disable Pan on two axis
multiRenderer.setPanEnabled(false, false);
multiRenderer.setYAxisMin(0);
multiRenderer.setLegendTextSize(22);
multiRenderer.addSeriesRenderer(renderer);
GraphicalView lineChartView = ChartFactory.getLineChartView(
getActivity(), dataSet, multiRenderer);
lineChartView.setMinimumHeight(550);
_graphArea.addView(lineChartView);
}
}
示例8: drawChart
import org.achartengine.renderer.XYSeriesRenderer; //導入方法依賴的package包/類
private void drawChart() {
mRenderer = new XYMultipleSeriesRenderer();
mDataset = new XYMultipleSeriesDataset();
XYSeriesRenderer renderer = new XYSeriesRenderer();
renderer.setLineWidth(5);
renderer.setColor(Color.parseColor("#0099cc"));
renderer.setDisplayBoundingPoints(true);
renderer.setPointStyle(PointStyle.CIRCLE);
renderer.setPointStrokeWidth(10);
//FillOutsideLine fillOutsideLine = new FillOutsideLine(Type.BOUNDS_ALL);
//fillOutsideLine.setColor(Color.parseColor("#0099cc"));
//renderer.addFillOutsideLine(fillOutsideLine);
//mRenderer.setChartTitle("Battery Level (%)");
mRenderer.setChartTitleTextSize(30f);
mRenderer.setLabelsTextSize(20f);
mRenderer.addSeriesRenderer(renderer);
mRenderer.setMarginsColor(Color.argb(0x00, 0xff, 0x00, 0x00));
mRenderer.setPanEnabled(true, false);
mRenderer.setZoomEnabled(false, false);
mRenderer.setYAxisMax(DeviceUtils.getBatteryScale(getActivity()));
mRenderer.setYAxisMin(0);
//mRenderer.setShowGrid(true);
mRenderer.setGridColor(Color.GRAY);
mRenderer.setClickEnabled(false);
TimeSeries series = new TimeSeries("");
/* long value = new Date().getTime() - 3 * TimeChart.DAY;
for (int i = 0; i < 5; i++) {
series.add(new Date(value + i * TimeChart.DAY / 4), i);
}*/
List<BatteryTrace> traces = BatteryTrace.getClosestTraceData(getActivity().getContentResolver(), LIMIT_DATE_SHOW);
boolean chartVisible = traces.size() >= MINIMUM_VALUE_TO_SHOW_CHART;
if (chartVisible) {
Calendar panMinimumX = Calendar.getInstance();
panMinimumX.set(Calendar.HOUR_OF_DAY, traces.get(0).hour);
panMinimumX.set(Calendar.MINUTE, traces.get(0).minutes);
Calendar panMaximumX = Calendar.getInstance();
panMaximumX.set(Calendar.HOUR_OF_DAY, traces.get(traces.size()-1).hour);
panMaximumX.set(Calendar.MINUTE, traces.get(traces.size()-1).minutes);
//mRenderer.setPanLimits(new double[] {panMinimumX.getTimeInMillis(), panMaximumX.getTimeInMillis() * 2, 0, 0});
for (BatteryTrace b : traces) {
//System.out.println(b.toString());
Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, b.hour);
c.set(Calendar.MINUTE, b.minutes);
series.add(c.getTime(), b.level);
}
mDataset.addSeries(series);
mChartView = ChartFactory.getTimeChartView(getActivity(), mDataset, mRenderer, "hh:mm aa");
}
}