I need to create a chart that has time along the x-axis and an area along the y-axis. The program is going to record data over a certain time differential for an activity and display the data in a graph, kind of like this -> https://i.stack.imgur.com/s4MiC.png but where every other bar would be alternating colors to correspond to a separate activity. I haven't been able to find a way to do this using MPAndroidChart yet, each entry seems to have a fixed width. If someone either knows how this can be achieved using MPAndroidChart or another open source library help would be appreciated, thanks!
EDIT:
This is the code I've been trying to work with:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_data_report);
BarChart barChart = (BarChart) findViewById(R.id.barChart);
List<BarEntry> entries = generateBarEntries();
BarDataSet set = new BarDataSet(entries, "BarDataSet");
BarData data = new BarData(set);
barChart.setData(data);
}
private List<BarEntry> generateBarEntries() {
List<BarEntry> entries = new ArrayList<>();
for (int i = 0; i < timeValues.size(); i++) {
float x = timeValues.get(i);
float y = areaValues.get(i);
entries.add(new BarEntry(x, y));
}
return entries;
}
timeValues is an ArrayList with values in seconds such as [3, 9, 21, 26, 33] and areaValues is also an ArrayList with the same size as timeValues with each value being 30 for now (i.e. [30, 30, 30, 30, 30]).
