| 2240 | } |
| 2241 | |
| 2242 | void SetupAxisTicks(ImAxis idx, const double* values, int n_ticks, const char* const labels[], bool show_default) { |
| 2243 | ImPlotContext& gp = *GImPlot; |
| 2244 | IM_ASSERT_USER_ERROR(gp.CurrentPlot != nullptr && !gp.CurrentPlot->SetupLocked, |
| 2245 | "Setup needs to be called after BeginPlot and before any setup locking functions (e.g. PlotX)!"); |
| 2246 | ImPlotPlot& plot = *gp.CurrentPlot; |
| 2247 | ImPlotAxis& axis = plot.Axes[idx]; |
| 2248 | IM_ASSERT_USER_ERROR(axis.Enabled, "Axis is not enabled! Did you forget to call SetupAxis()?"); |
| 2249 | axis.ShowDefaultTicks = show_default; |
| 2250 | AddTicksCustom(values, |
| 2251 | labels, |
| 2252 | n_ticks, |
| 2253 | axis.Ticker, |
| 2254 | axis.Formatter ? axis.Formatter : Formatter_Default, |
| 2255 | (axis.Formatter && axis.FormatterData) ? axis.FormatterData : axis.HasFormatSpec ? axis.FormatSpec : (void*)IMPLOT_LABEL_FORMAT); |
| 2256 | } |
| 2257 | |
| 2258 | void SetupAxisTicks(ImAxis idx, double v_min, double v_max, int n_ticks, const char* const labels[], bool show_default) { |
| 2259 | ImPlotContext& gp = *GImPlot; |
no test coverage detected