Skip to content

Commit

Permalink
Remove bar groups when resetting data in bar graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake-Madden committed Oct 7, 2023
1 parent 731f71f commit f429a1d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/graphs/barchart.h
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,9 @@ namespace Wisteria::Graphs
m_barGroups.push_back(std::move(barGroup));
AdjustScalingAxisFromBarGroups();
}
/// @brief Removes all bar groups from the bar chart.
void ClearBarGroups()
{ m_barGroups.clear(); }

/// @returns How the bar groups (brackets and cumulative bars) are aligned with their respective bars.
[[nodiscard]]
Expand Down
1 change: 1 addition & 0 deletions src/graphs/categoricalbarchart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ namespace Wisteria::Graphs
m_useIDColumnForBars = false;
GetSelectedIds().clear();
ClearBars();
ClearBarGroups();

if (GetDataset() == nullptr)
{ return; }
Expand Down
1 change: 1 addition & 0 deletions src/graphs/ganttchart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ namespace Wisteria::Graphs
SetDataset(data);
ResetGrouping();
ClearBars();
ClearBarGroups();
GetSelectedIds().clear();
m_legendTitle.clear();

Expand Down
1 change: 1 addition & 0 deletions src/graphs/histogram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ namespace Wisteria::Graphs
ResetGrouping();
GetSelectedIds().clear();
ClearBars();
ClearBarGroups();

if (GetDataset() == nullptr)
{ return; }
Expand Down
1 change: 1 addition & 0 deletions src/graphs/likertchart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ namespace Wisteria::Graphs
{ return; }

GetSelectedIds().clear();
ClearBarGroups();
m_positive1Label.clear();
m_positive2Label.clear();
m_positive3Label.clear();
Expand Down

0 comments on commit f429a1d

Please sign in to comment.