0
普通のLineAndPointRenderer
を使用すると、すべての凡例アイコンが正常に表示されます。「FastLineAndPointRenderer」を使用しているときは、散布図の凡例アイコンは空白です
//works but is slow
private LineAndPointFormatter getScatterPlotFormatter() {
LineAndPointFormatter formatter = new LineAndPointFormatter(
Color.TRANSPARENT,
Color.argb(0xFF, mRandom.nextInt(0xFF), mRandom.nextInt(0xFF), mRandom.nextInt(0xFF)),
null,
null
);
formatter.getVertexPaint().setStrokeWidth(getContext().getResources().getDimension(R.dimen.chart_vertex_size));
return formatter;
}
documentation私が代わりにFastLineAndPointRenderer
を使用することをお勧めしますが、私が行うとき、凡例のアイコンが空白で表示されます。これは散布図にのみ影響します。
//does not show proper legend icon
private LineAndPointFormatter getScatterPlotFormatter() {
FastLineAndPointRenderer.Formatter formatter = new FastLineAndPointRenderer.Formatter(
Color.TRANSPARENT,
Color.argb(0xFF, mRandom.nextInt(0xFF), mRandom.nextInt(0xFF), mRandom.nextInt(0xFF)),
null
);
formatter.getVertexPaint().setStrokeWidth(getContext().getResources().getDimension(R.dimen.chart_vertex_size));
return formatter;
}
「FastLineAndPointRenderer」実装のバグのようです。それを追跡するために[このレポート](https://github.com/halfhp/androidplot/issues/39)を作成しました。次のリリースで修正されます。上のあなたのアプローチは、中間の良い解決策のように見えます。 – Nick