| 2205 | } |
| 2206 | |
| 2207 | void SetupAxisFormat(ImAxis idx, const char* fmt) { |
| 2208 | ImPlotContext& gp = *GImPlot; |
| 2209 | IM_ASSERT_USER_ERROR(gp.CurrentPlot != nullptr && !gp.CurrentPlot->SetupLocked, |
| 2210 | "Setup needs to be called after BeginPlot and before any setup locking functions (e.g. PlotX)!"); |
| 2211 | ImPlotPlot& plot = *gp.CurrentPlot; |
| 2212 | ImPlotAxis& axis = plot.Axes[idx]; |
| 2213 | IM_ASSERT_USER_ERROR(axis.Enabled, "Axis is not enabled! Did you forget to call SetupAxis()?"); |
| 2214 | axis.HasFormatSpec = fmt != nullptr; |
| 2215 | if (fmt != nullptr) |
| 2216 | ImStrncpy(axis.FormatSpec,fmt,sizeof(axis.FormatSpec)); |
| 2217 | } |
| 2218 | |
| 2219 | void SetupAxisLinks(ImAxis idx, double* min_lnk, double* max_lnk) { |
| 2220 | ImPlotContext& gp = *GImPlot; |
no test coverage detected