我有一个这样的情节设置:
aHistoryPlot = (XYPlot) findViewById(R.id.plot);
aHistoryPlot.setRangeBoundaries(0, 255, BoundaryMode.FIXED);
aHistoryPlot.setDomainBoundaries(0, HISTORY_SIZE, BoundaryMode.FIXED);
aHistoryPlot.addSeries(YHistorySeries, new LineAndPointFormatter(Color.rgb(100, 200, 100), Color.TRANSPARENT, null));
aHistoryPlot.getGraphWidget().setMarginTop(10);
aHistoryPlot.setDomainStepValue(5);
aHistoryPlot.setTicksPerRangeLabel(3);
aHistoryPlot.setDomainLabel(getResources().getString(R.string.string_time));
aHistoryPlot.getDomainLabelWidget().pack();
aHistoryPlot.setRangeLabel(getResources().getString(R.string.string_value));
aHistoryPlot.getRangeLabelWidget().pack();
aHistoryPlot.disableAllMarkup();
Run Code Online (Sandbox Code Playgroud)
如何从图中删除域值?
提前致谢!
我正在尝试绘制 AndroidPlot 背景的渐变,我需要的只是一个 Paint 对象。
所以我会使用这段代码:
int[] co = new int[]{颜色.红色,颜色.黄色,颜色.绿色,颜色.黄色,颜色.红色};
float[] coP = new float[]{0.1f,0.1f,0.6f,0.1f,0.1f};
>Paint pa = new Paint();
>pa.setAlpha(200);
>pa.setShader(new LinearGradient(0,0,250,graphv.getHeight(),co,coP,Shader.TileMode.REPEAT));
Run Code Online (Sandbox Code Playgroud)
但背景只有一种颜色:红色。
我不知道为什么,或者如何解决它。
你有什么想法?
我目前试图使我的情节看起来像这样:

但我不知道如何自定义点在橙色填充周围有黑色笔划,所以我的点现在"胶合"到线条.

或者,至少如何使它看起来像这样(与线相同颜色的外圈).

有帮助吗?
简短问题:
如何将Android图的X轴设置为日历(日期和时间)元素?
for(int i=1; i<sY.length;i++)
{
Log.d("Watcher","sY:"+sY[i]);
nY[i] = (Number)Double.parseDouble(sY[i]);
}
for(int i=1; i<sX.length;i++)
{
Log.d("Watcher","sX: "+sX[i]);
nX[i] = (Number)Double.parseDouble(sX[i]);
}
XYSeries series = new SimpleXYSeries(
Arrays.asList(nY),
SimpleXYSeries.ArrayFormat.Y_VALS_ONLY,
getTitle);
LineAndPointFormatter seriesFormat = new LineAndPointFormatter(
Color.rgb(0, 200, 0), // line color
Color.rgb(0, 100, 0), // point color
Color.rgb(150, 190, 150)); // fill color (optional)
oneChart.addSeries(series, seriesFormat);
oneChart.disableAllMarkup();
Run Code Online (Sandbox Code Playgroud) 是否有线条样式用于虚线,虚线等?
我知道你可以通过将vertexColor设置为null来添加/删除该点,如下例所示:
LineAndPointFormatter blueFormat = new LineAndPointFormatter(Color.rgb(30,144,255), null, null);
Run Code Online (Sandbox Code Playgroud)
但是,我无法在javadoc中找到像"setDottedLine(true)"这样的快速属性设置或类似的东西.我想我可以解析每10个点并在解析时每10个点掉一次,但这可能比需要的开销略高.
是否有使用LineAndPointFormatter创建虚线或通过设置其他小部件属性的解决方法或技巧?
我正在为Androidplot传递一个x值介于0到100之间的系列,但我只想显示从90到100的范围.我该如何做到这一点?
每秒使用新数据重新绘制图表.我的计划是在redraw()设置x轴范围之前调用一些命令.
我正在使用AndroidPlot库,并尝试更改域和范围标签的颜色。
我将它们设置为:
//Setting the names of the axis
XYPlot.setRangeLabel("# of Alerts");
XYPlot.setDomainLabel("Day");
Run Code Online (Sandbox Code Playgroud)
默认情况下,它们是白色的,但是在我的乳白色背景下几乎看不到。有谁知道我可以将其更改为黑色吗?