我有一個心電圖圖形應用程序,圖形看起來像這樣。識別AndroidPlot中繪製點的網格
我需要知道的是,是否有可能知道在哪個點繪製的亞格說...格式如(ROW_INDEX,Column_Index中),或者是這樣的。其實我不知道這是否是一種可能的情況。所以,如果沒有辦法做到這一點,請讓我知道。 下面給出了我的圖形配置方法。
private void configureGraph() {
/**
* ecgPlot corresponds to XYPlot
*/
XYGraphWidget graph = ecgPlot.getGraph();
/**
* Paint to denote line color
*/
Paint paint = new Paint();
paint.setColor(Color.WHITE);
paint.setStrokeWidth(3.0f);
/**
* Setting graph x and y boundary values
*/
ecgPlot.setRangeBoundaries(-40, 40, BoundaryMode.FIXED);
ecgPlot.setDomainBoundaries(0, 1500, BoundaryMode.FIXED);
ecgPlot.setPlotPadding(-10, 0, 0, 0);
/**
* Removes default bkg - ie; black
*/
ecgPlot.setBackgroundPaint(null);
graph.setBackgroundPaint(null);
graph.setGridBackgroundPaint(null);
/**
* Adjusting grid line width
*/
graph.getDomainGridLinePaint().setStrokeWidth(4.0f);
graph.getRangeGridLinePaint().setStrokeWidth(4.0f);
graph.getDomainSubGridLinePaint().setStrokeWidth(1.0f);
graph.getRangeSubGridLinePaint().setStrokeWidth(1.0f);
/**
* Removes border
*/
ecgPlot.setBorderPaint(null);
/**
* Setting grid color
*/
graph.getDomainGridLinePaint().setColor(getResources().getColor(R.color.colorECGGrid));
graph.getRangeGridLinePaint().setColor(getResources().getColor(R.color.colorECGGrid));
graph.getRangeSubGridLinePaint().setColor(getResources().getColor(R.color.colorECGGrid));
graph.getDomainSubGridLinePaint().setColor(getResources().getColor(R.color.colorECGGrid));
/**
* Setting number of sub grid lines per grid
*/
graph.setLinesPerDomainLabel(5);
graph.setLinesPerRangeLabel(5);
ecgPlot.setRangeStep(StepMode.INCREMENT_BY_VAL, 1);
ecgPlot.setDomainStepValue(75);
ecgPlot.setLinesPerDomainLabel(5);
ecgPlot.setDomainLabel(null);
ecgPlot.setRangeLabel(null);
Paint paintTest = new Paint();
paintTest.setColor(Color.TRANSPARENT);
paintTest.setStrokeWidth(3.0f);
ecgLinePointFormatter.setLegendIconEnabled(false);
// PointLabelFormatter pointLabelFormatter = new PointLabelFormatter();
// pointLabelFormatter.setTextPaint(paint);
}
在此先感謝
只是爲了確認,通過子網格你的意思是上述網格的5×5部分,是嗎? – Nick
是的。準確地@Nick –
你能展示你定義網格間距的代碼部分以及任何特殊的域/範圍邊界配置嗎? (你如何完成你的要求取決於這些變量) – Nick