| 2157 | } |
| 2158 | |
| 2159 | void SetupAxisFormat(ImAxis idx, const char* fmt) { |
| 2160 | ImPlotContext& gp = *GImPlot; |
| 2161 | IM_ASSERT_USER_ERROR(gp.CurrentPlot != nullptr && !gp.CurrentPlot->SetupLocked, |
| 2162 | "Setup needs to be called after BeginPlot and before any setup locking functions (e.g. PlotX)!"); |
| 2163 | ImPlotPlot& plot = *gp.CurrentPlot; |
| 2164 | ImPlotAxis& axis = plot.Axes[idx]; |
| 2165 | IM_ASSERT_USER_ERROR(axis.Enabled, "Axis is not enabled! Did you forget to call SetupAxis()?"); |
| 2166 | axis.HasFormatSpec = fmt != nullptr; |
| 2167 | if (fmt != nullptr) |
| 2168 | ImStrncpy(axis.FormatSpec,fmt,sizeof(axis.FormatSpec)); |
| 2169 | } |
| 2170 | |
| 2171 | void SetupAxisLinks(ImAxis idx, double* min_lnk, double* max_lnk) { |
| 2172 | ImPlotContext& gp = *GImPlot; |
no test coverage detected