AndroidPlot: elimina los valores de dominio de GraphWidget
Tengo una configuración de la trama como esta:
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();
¿Cómo puedo eliminar los valores de dominio de la trama?
- Dar permiso de actividad en AndroidManifest
- Reloj de cuenta atrás en android
- SSL SSLSockets con certificados autofirmados
- SearchView escucha voces
- El documento no tiene excepción de elemento raíz utilizando el serializador xml simple (v2.6.6)
¡Gracias por adelantado!
- Aplicación de realidad aumentada de Android convertir Lista de ubicación desde el punto de pantalla
- Varias llaves y valores de JSONObject no se guardarán en Parse
- Carácter turco en SQLite mientras utiliza la expresión LIKE
- Manera elegante de leer el archivo en el arsenal del byte en Java
- Widget no se actualiza después de cambios de configuración
- Cómo obtener la URL actual en un navegador de Android
- ¿Cómo detectar cuando la batería es baja: Android?
- Añadir oyente a oyente conjunto
Puedes entrar:
aHistoryPlot.getGraphWidget().getDomainLabelPaint.setColor(Color.TRANSPARENT);
Ajuste de la pintura a null Creo que es un poco mejor que también obtener el espacio de nuevo que los lables ocupan. Aquí está el código que tengo en mi código de prueba de velocidad para conmutar todos estos bits y desactivarlo.
if (!mBackgroundOn) { // remove the background stuff. mDynamicPlot.setBackgroundPaint(null); mDynamicPlot.getGraphWidget().setBackgroundPaint(null); mDynamicPlot.getGraphWidget().setGridBackgroundPaint(null); } if (!mKeyOn) mDynamicPlot.getLayoutManager() .remove(mDynamicPlot.getLegendWidget()); if (!mDomainLabelOn) mDynamicPlot.getLayoutManager().remove( mDynamicPlot.getDomainLabelWidget()); if (!mDomainAxisOn) { mDynamicPlot.getGraphWidget().setDomainLabelPaint(null); mDynamicPlot.getGraphWidget().setDomainOriginLabelPaint(null); } if (!mBoarderOn){ //mDynamicPlot.setDrawBorderEnabled(false); mDynamicPlot.setBorderPaint(null); }if (!mRangeLabelOn) mDynamicPlot.getLayoutManager().remove( mDynamicPlot.getRangeLabelWidget()); if (!mRangeAxisOn) { mDynamicPlot.getGraphWidget().setRangeLabelPaint(null); mDynamicPlot.getGraphWidget().setRangeOriginLabelPaint(null); //mDynamicPlot.getGraphWidget().setRangeLabelVerticalOffset(rangeLabelVerticalOffset); } if (!mGridOn) { //mDynamicPlot.getGraphWidget().setGridLinePaint(null); mDynamicPlot.getGraphWidget().setDomainOriginLinePaint(null); mDynamicPlot.getGraphWidget().setRangeOriginLinePaint(null); } if (!mTitleOn) { mDynamicPlot.getLayoutManager().remove(mDynamicPlot.getTitleWidget()); }
Establecer esto, le permitirá deshacerse de todas las cosas de rejilla / frontera, y le permiten tener un estilo de gráfico transparente.
aprHistoryPlot.setPlotMargins(0, 0, 0, 0); aprHistoryPlot.setPlotPadding(0, 0, 0, 0); aprHistoryPlot.setDomainLabelWidget(null); aprHistoryPlot.setRangeLabelWidget(null); aprHistoryPlot.setBackgroundPaint(null); aprHistoryPlot.getGraphWidget().setBackgroundPaint(null); aprHistoryPlot.getGraphWidget().setGridBackgroundPaint(null); aprHistoryPlot.setBorderPaint(null); //aprHistoryPlot.setDomainLabel( null ); // crash //aprHistoryPlot.setRangeLabel( null ); aprHistoryPlot.getGraphWidget().setDomainLabelWidth(0.0f); aprHistoryPlot.getGraphWidget().setRangeLabelWidth(0.0f); aprHistoryPlot.getGraphWidget().setDomainLabelPaint(null); aprHistoryPlot.getGraphWidget().setDomainOriginLabelPaint(null); aprHistoryPlot.getGraphWidget().setRangeLabelPaint(null); aprHistoryPlot.getGraphWidget().setRangeOriginLabelPaint(null); aprHistoryPlot.getGraphWidget().setDomainOriginLinePaint(null); aprHistoryPlot.getGraphWidget().setRangeOriginLinePaint(null); aprHistoryPlot.getLayoutManager().remove(aprHistoryPlot.getTitleWidget()); aprHistoryPlot.getGraphWidget().getDomainGridLinePaint().setColor(Color.TRANSPARENT); aprHistoryPlot.getGraphWidget().getRangeGridLinePaint().setColor(Color.TRANSPARENT); aprHistoryPlot.getGraphWidget().getRangeSubGridLinePaint().setColor(Color.TRANSPARENT); aprHistoryPlot.getLayoutManager().remove(aprHistoryPlot.getLegendWidget()); aprHistoryPlot.getLayoutManager().remove(aprHistoryPlot.getDomainLabelWidget()); aprHistoryPlot.getLayoutManager().remove(aprHistoryPlot.getRangeLabelWidget());