fix x axis on overview when no data displayed
This commit is contained in:
parent
738d4c1c2a
commit
49453e10df
1 changed files with 7 additions and 7 deletions
|
@ -683,6 +683,13 @@ public class OverviewFragment extends Fragment {
|
|||
}
|
||||
});
|
||||
|
||||
// set manual x bounds to have nice steps
|
||||
bgGraph.getViewport().setMaxX(toTime);
|
||||
bgGraph.getViewport().setMinX(fromTime);
|
||||
bgGraph.getViewport().setXAxisBoundsManual(true);
|
||||
bgGraph.getGridLabelRenderer().setLabelFormatter(new TimeAsXAxisLabelFormatter(getActivity(), "HH"));
|
||||
bgGraph.getGridLabelRenderer().setNumHorizontalLabels(7); // only 7 because of the space
|
||||
|
||||
// **** BG graph ****
|
||||
List<BgReading> bgReadingsArray = MainApp.getDbHelper().getDataFromTime(fromTime);
|
||||
List<BgReading> inRangeArray = new ArrayList<BgReading>();
|
||||
|
@ -763,13 +770,6 @@ public class OverviewFragment extends Fragment {
|
|||
seriesTreatments.setColor(Color.CYAN);
|
||||
}
|
||||
|
||||
// set manual x bounds to have nice steps
|
||||
bgGraph.getViewport().setMaxX(toTime);
|
||||
bgGraph.getViewport().setMinX(fromTime);
|
||||
bgGraph.getViewport().setXAxisBoundsManual(true);
|
||||
bgGraph.getGridLabelRenderer().setLabelFormatter(new TimeAsXAxisLabelFormatter(getActivity(), "HH"));
|
||||
bgGraph.getGridLabelRenderer().setNumHorizontalLabels(7); // only 7 because of the space
|
||||
|
||||
// set manual y bounds to have nice steps
|
||||
bgGraph.getViewport().setMaxY(maxBgValue);
|
||||
bgGraph.getViewport().setMinY(0);
|
||||
|
|
Loading…
Reference in a new issue