@@ -812,6 +812,7 @@ void GraphView::DrawGroupedGraphs(const GraphGroupPtr& vGraphGroupPtr, const ImV
812
812
double last_value = _data_ptr_0->value , current_value;
813
813
std::string last_string = _data_ptr_0->string , current_string;
814
814
std::string last_status = _data_ptr_0->status , current_status;
815
+ std::string last_desc = _data_ptr_0->desc , current_desc;
815
816
bool _is_h_hovered = false ;
816
817
817
818
last_value_pos = ImPlot::PlotToPixels (last_time, _data_ptr_0->value );
@@ -822,6 +823,11 @@ void GraphView::DrawGroupedGraphs(const GraphGroupPtr& vGraphGroupPtr, const ImV
822
823
current_value = _data_ptr_i->value ;
823
824
current_string = _data_ptr_i->string ;
824
825
current_status = _data_ptr_i->status ;
826
+ current_desc = _data_ptr_i->desc ;
827
+ if (i == 1U && !current_desc.empty () && last_desc.empty ()) {
828
+ last_desc = current_desc;
829
+ }
830
+
825
831
value_pos = ImPlot::PlotToPixels (current_time, current_value);
826
832
827
833
ImPlot::FitPoint (ImPlotPoint (current_time, current_value));
@@ -912,12 +918,17 @@ void GraphView::DrawGroupedGraphs(const GraphGroupPtr& vGraphGroupPtr, const ImV
912
918
if (last_string.empty ()) {
913
919
// tofix : to refactor
914
920
const auto p_min = ImGui::GetCursorScreenPos () - ImVec2 (spacing_L, spacing_U);
915
- const auto p_max = ImVec2 (p_min.x + ImGui::GetContentRegionAvail ().x + spacing_R,
916
- p_min.y + (ImGui::GetFrameHeight () - spacing_D));
921
+ const auto p_max = ImVec2 ( //
922
+ p_min.x + ImGui::GetContentRegionAvail ().x + spacing_R,
923
+ p_min.y + (ImGui::GetFrameHeight () - spacing_D) * 2 .0f );
917
924
ImGui::GetWindowDrawList ()->AddRectFilled (p_min, p_max, _color);
918
925
const bool pushed = ImGui::PushStyleColorWithContrast4 (
919
926
_color, ImGuiCol_Text, ImGui::CustomStyle::puContrastedTextColor, ImGui::CustomStyle::puContrastRatio);
920
- ImGui::Text (" %s : %f" , name_str.c_str (), last_value);
927
+ if (!last_desc.empty ()) {
928
+ ImGui::Text (" %f (%s) %s" , last_value, last_desc.c_str (), name_str.c_str ());
929
+ } else {
930
+ ImGui::Text (" %f %s" , last_value, name_str.c_str ());
931
+ }
921
932
if (pushed)
922
933
ImGui::PopStyleColor ();
923
934
} else {
@@ -963,6 +974,7 @@ void GraphView::DrawGroupedGraphs(const GraphGroupPtr& vGraphGroupPtr, const ImV
963
974
last_value = current_value;
964
975
last_string = current_string;
965
976
last_status = current_status;
977
+ last_desc = current_desc;
966
978
}
967
979
}
968
980
0 commit comments