diff --git a/include/fg/chart.h b/include/fg/chart.h index 78dfc0fb..c869e7ab 100644 --- a/include/fg/chart.h +++ b/include/fg/chart.h @@ -308,6 +308,16 @@ Remove a Histogram object from the current chart FGAPI fg_err fg_remove_histogram_from_chart(fg_chart pHandle, fg_histogram pHistogram); +/** +Remove a Pie object from the current chart + +\param[in] pHandle is chart handle +\param[in] pPie is the handle of the pie object to remove + +\return \ref fg_err error code +*/ +FGAPI fg_err fg_remove_pie_from_chart(fg_chart pHandle, fg_pie pPie); + /** Remove a Plot object from the current chart @@ -526,6 +536,13 @@ class Chart { */ FGAPI void remove(const Histogram &pHistogram); + /** + Remove an existing Pie object to the current chart + + \param[in] pPie is the Pie to remove from the chart + */ + FGAPI void remove(const Pie &pPie); + /** Remove an existing Plot object to the current chart diff --git a/src/api/c/chart.cpp b/src/api/c/chart.cpp index 22438665..76171d33 100644 --- a/src/api/c/chart.cpp +++ b/src/api/c/chart.cpp @@ -375,6 +375,21 @@ fg_err fg_remove_histogram_from_chart(fg_chart pChart, return FG_ERR_NONE; } +fg_err fg_remove_pie_from_chart(fg_chart pChart, fg_pie pPie) { + try { + ARG_ASSERT(0, (pPie != 0)); + ARG_ASSERT(1, (pChart != 0)); + + common::Chart* chrt = getChart(pChart); + + common::Pie* pie = getPie(pPie); + chrt->removeRenderable(pie->impl()); + } + CATCHALL + + return FG_ERR_NONE; +} + fg_err fg_remove_plot_from_chart(fg_chart pChart, fg_plot pPlot) { try { ARG_ASSERT(0, (pPlot != 0)); diff --git a/src/api/cpp/chart.cpp b/src/api/cpp/chart.cpp index 516f967e..8a4e3c6f 100644 --- a/src/api/cpp/chart.cpp +++ b/src/api/cpp/chart.cpp @@ -92,6 +92,10 @@ void Chart::remove(const Histogram& pHistogram) { FG_THROW(fg_remove_histogram_from_chart(get(), pHistogram.get())); } +void Chart::remove(const Pie& pPie) { + FG_THROW(fg_remove_pie_from_chart(get(), pPie.get())); +} + void Chart::remove(const Plot& pPlot) { FG_THROW(fg_remove_plot_from_chart(get(), pPlot.get())); }