本文整理匯總了Java中org.achartengine.chart.PointStyle.DIAMOND屬性的典型用法代碼示例。如果您正苦於以下問題:Java PointStyle.DIAMOND屬性的具體用法?Java PointStyle.DIAMOND怎麽用?Java PointStyle.DIAMOND使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.achartengine.chart.PointStyle
的用法示例。
在下文中一共展示了PointStyle.DIAMOND屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: execute
/**
* Executes the chart demo.
*
* @param context the context
* @return the built intent
*/
public Intent execute(Context context) {
String[] titles = new String[] { "Series 1", "Series 2", "Series 3", "Series 4", "Series 5" };
List<double[]> x = new ArrayList<double[]>();
List<double[]> values = new ArrayList<double[]>();
int count = 20;
int length = titles.length;
Random r = new Random();
for (int i = 0; i < length; i++) {
double[] xValues = new double[count];
double[] yValues = new double[count];
for (int k = 0; k < count; k++) {
xValues[k] = k + r.nextInt() % 10;
yValues[k] = k * 2 + r.nextInt() % 10;
}
x.add(xValues);
values.add(yValues);
}
int[] colors = new int[] { Color.BLUE, Color.CYAN, Color.MAGENTA, Color.LTGRAY, Color.GREEN };
PointStyle[] styles = new PointStyle[] { PointStyle.X, PointStyle.DIAMOND, PointStyle.TRIANGLE,
PointStyle.SQUARE, PointStyle.CIRCLE };
XYMultipleSeriesRenderer renderer = buildRenderer(colors, styles);
setChartSettings(renderer, "Scatter chart", "X", "Y", -10, 30, -10, 51, Color.GRAY,
Color.LTGRAY);
renderer.setXLabels(10);
renderer.setYLabels(10);
length = renderer.getSeriesRendererCount();
for (int i = 0; i < length; i++) {
((XYSeriesRenderer) renderer.getSeriesRendererAt(i)).setFillPoints(true);
}
return ChartFactory.getScatterChartIntent(context, buildDataset(titles, x, values), renderer);
}