3

私はこのようなプロット設定をしています:

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();

プロットからドメイン値を削除するにはどうすればよいですか?

前もって感謝します!

4

3 に答える 3

8

ペイントを null に設定すると、ラベルが占めるスペースを取り戻すこともできます。これらすべてのビットのオンとオフを切り替えるために、速度テスト コードに含まれているコードを次に示します。

    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());
    }
于 2012-12-08T12:50:13.637 に答える
6

次のように入力できます。

aHistoryPlot.getGraphWidget().getDomainLabelPaint.setColor(Color.TRANSPARENT);
于 2012-12-07T13:18:55.447 に答える
2

これを設定すると、すべてのグリッド/境界線を取り除くことができ、透明なグラフ スタイルを使用できるようになります。

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());
于 2014-07-09T09:40:29.327 に答える