| 2897 | |
| 2898 | template <typename T> |
| 2899 | double PieChartSum(IndexerIdx<T> indexer, bool ignore_hidden) { |
| 2900 | double sum = 0; |
| 2901 | if (ignore_hidden) { |
| 2902 | ImPlotContext& gp = *GImPlot; |
| 2903 | ImPlotItemGroup& Items = *gp.CurrentItems; |
| 2904 | for (int i = 0; i < indexer.Count; ++i) { |
| 2905 | if (i >= Items.GetItemCount()) |
| 2906 | break; |
| 2907 | |
| 2908 | ImPlotItem* item = Items.GetItemByIndex(i); |
| 2909 | IM_ASSERT(item != nullptr); |
| 2910 | if (item->Show) { |
| 2911 | sum += (double)indexer[i]; |
| 2912 | } |
| 2913 | } |
| 2914 | } |
| 2915 | else { |
| 2916 | for (int i = 0; i < indexer.Count; ++i) { |
| 2917 | sum += (double)indexer[i]; |
| 2918 | } |
| 2919 | } |
| 2920 | return sum; |
| 2921 | } |
| 2922 | |
| 2923 | template <typename T> |
| 2924 | void PlotPieChartEx(const char* const label_ids[], IndexerIdx<T> indexer, ImPlotPoint center, double radius, double angle0, const ImPlotSpec& spec) { |
no test coverage detected