Skip to content

Commit

Permalink
Cursor visible in plot, axis set before first plot
Browse files Browse the repository at this point in the history
  • Loading branch information
AKMaily committed Oct 17, 2024
1 parent 244b470 commit 49de8fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,17 @@ void addPlots(const char *name, fs::path &AnalyzedFilePath, bool &LOADANALYSISDA
axesSetup) {
static std::set<std::string> firstRun;
auto const plotRegion = ImGui::GetContentRegionAvail();
ImVec2 adjustedPlotRegion(plotRegion.x - 100, plotRegion.y);
// TODO search devices must work aswell
plotAxes = getDeviceInfos();

if (ImPlot::BeginPlot(name, adjustedPlotRegion, ImPlotFlags_NoFrame)) {
if (ImPlot::BeginPlot(name, plotRegion)) {
ImPlot::SetupAxis(ImAxis_X1, "[x]");
ImPlot::SetupAxis(ImAxis_Y1, "[y]");

if(!AnalyzedFilePath.empty() && LOADANALYSISDATA){
AddPlotFromFile(AnalyzedFilePath);
ImPlot::EndPlot();
ImPlot::PopStyleColor();
ImPlot::PopStyleColor();
}
else {

Expand Down
5 changes: 2 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,11 @@ int main() {
appLanguage[Key::Recording_Data],AnalyzedFilePath,LOADANALYSISDATA,
[flagPaused](double x_max, std::string yLabel, ImAxis_ axis,
double yMin, double yMax) {
ImPlot::SetupLegend(ImPlotLocation_NorthEast);
ImPlot::SetupLegend(ImPlotLocation_NorthWest);
// auto auxFlagsMeasuring =
// ImPlotAxisFlags_AutoFit | ImPlotAxisFlags_NoGridLines;
// auto auxFlagsPaused = ImPlotAxisFlags_NoGridLines;
ImPlot::SetupAxisTicks(ImAxis_Y1, -10, 200, 22, nullptr, true);

//ImPlot::SetupAxisTicks(ImAxis_Y1, -10, 200, 22, nullptr, true);
if (!flagPaused) {
ImPlot::SetupAxis(axis, yLabel.c_str(), ImPlotAxisFlags_AutoFit);
ImPlot::SetupAxis(ImAxis_X1, appLanguage[Key::Time_sec],
Expand Down

0 comments on commit 49de8fd

Please sign in to comment.