@@ -699,7 +699,7 @@ void TimeScatterChart::updateData(const QList<DateScatterSeries*>& seriesData, Q
699
699
break ;
700
700
}
701
701
}
702
- if (noData) {
702
+ if (noData && !usePinnedRanges ) {
703
703
reset ();
704
704
return ;
705
705
}
@@ -877,7 +877,7 @@ void HistogramChart::reset()
877
877
barSet->remove (0 , barSet->count ());
878
878
hasData = false ;
879
879
for (const bool p : {false , true }) {
880
- maxY [p] = 0 ;
880
+ maxY[p] = 0 ;
881
881
}
882
882
resetAxis (yAxis, true );
883
883
}
@@ -914,15 +914,21 @@ void HistogramChart::updateData(QList<qreal> histogramData, qreal newMaxY, bool
914
914
}
915
915
}
916
916
if (noData) {
917
- reset ();
917
+ if (usePinnedRanges) {
918
+ barSet->remove (0 , barSet->count ());
919
+ hasData = true ;
920
+ updateView ();
921
+ } else {
922
+ reset ();
923
+ }
918
924
return ;
919
925
}
920
926
assert (newMaxY > 0 );
921
927
922
928
for (int p = 0 ; p < (setPinnedRanges ? 2 : 1 ); p++) {
923
929
maxY[p] = newMaxY;
924
930
}
925
-
931
+
926
932
hasData = true ;
927
933
updateView ();
928
934
@@ -938,7 +944,7 @@ void HistogramChart::updateView()
938
944
if (!hasData) return ;
939
945
940
946
const bool p = usePinnedRanges;
941
- adjustAxis (yAxis, 0 , maxY[p], chart->plotArea ().width (), rangeBufferFactorY);
947
+ adjustAxis (yAxis, 0 , maxY[p], chart->plotArea ().width (), rangeBufferFactorY);
942
948
}
943
949
944
950
@@ -1026,7 +1032,13 @@ void TopNChart::updateData(QStringList labels, QList<qreal> values, bool setPinn
1026
1032
assert (labels.size () <= n);
1027
1033
1028
1034
if (values.isEmpty ()) {
1029
- reset ();
1035
+ if (usePinnedRanges) {
1036
+ barSet->remove (0 , barSet->count ());
1037
+ hasData = true ;
1038
+ updateView ();
1039
+ } else {
1040
+ reset ();
1041
+ }
1030
1042
return ;
1031
1043
}
1032
1044
@@ -1057,7 +1069,7 @@ void TopNChart::updateView()
1057
1069
if (!hasData) return ;
1058
1070
1059
1071
const bool p = usePinnedRanges;
1060
- adjustAxis (yAxis, 0 , maxY[p], chart->plotArea ().width (), rangeBufferFactorY);
1072
+ adjustAxis (yAxis, 0 , maxY[p], chart->plotArea ().width (), rangeBufferFactorY);
1061
1073
}
1062
1074
1063
1075
0 commit comments