MPAndroidChart PieChart没有显示Markerview

时间:2015-05-19 07:21:17

标签: android pie-chart mpandroidchart

我正在实现Piechart,我想在切片选择上显示Markerview,就像在Barchart中一样。所以我为Piechart设置了Markerview。

mChart = (PieChart) findViewById(R.id.chart1);
    MyMarkerView mv = new MyMarkerView(this, R.layout.custom_marker_view);
    mChart.setMarkerView(mv);
    mChart.getMarkerView().setEnabled(true);

我不想自定义Markerview。我使用与BarChart相同的Markerview。 我甚至删除了chartValueSelectedListener。

//mChart.setOnChartValueSelectedListener(this);

但是标记视图不可见。

1 个答案:

答案 0 :(得分:1)

对不起,文档中没有明确说明。

但PieCharts和Horizo​​ntalBarChart目前不支持MarkerView。它是唯一尚未使用的图表类型。

<强>更新

由于MarkerView PieChart 现已支持,因此HorizontalBarCharttry { $p = new PDFlib(); # This means we must check return values of load_font() etc. $p->set_option("errorpolicy=return"); /* Enable the following line if you experience crashes on OS X * (see PDFlib-in-PHP-HowTo.pdf for details): * $p->set_option("usehostfonts=false"); */ /* all strings are expected as utf8 */ $p->set_option("stringformat=utf8"); /* open new PDF file; insert a file name to create the PDF on disk */ if ($p->begin_document("", "") == 0) { die("Error: " . $p->get_errmsg()); } $p->set_info("Creator", "hello.php"); $p->set_info("Author", "Rainer Schaaf"); $p->set_info("Title", "Hello world (PHP)!"); $p->begin_page_ext(595, 842, ""); $font = $p->load_font("Helvetica-Bold", "unicode", ""); if ($font == 0) { die("Error: " . $p->get_errmsg()); } $p->setfont($font, 24.0); $p->set_text_pos(50, 700); $p->show("Hello world!"); $p->continue_text("(says PHP)"); $p->end_page_ext(""); $p->end_document(""); $buf = $p->get_buffer(); $len = strlen($buf); header("Content-type: application/pdf"); header("Content-Length: $len"); header("Content-Disposition: inline; filename=hello.pdf"); print $buf; } catch (PDFlibException $e) { die("PDFlib exception occurred in hello sample:\n" . "[" . $e->get_errnum() . "] " . $e->get_apiname() . ": " . $e->get_errmsg() . "\n"); } catch (Exception $e) { die($e); } $p = 0;` 也是如此。