Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

...

...

Image Modified

Inhalt:

Anchor
Data
Data

Optimale Datenstruktur (Datenbank):

Kategorie 1 - y-AchseKategorie - x-AchseBeginnEnde
Projekt 1Aufgabe 1

28.04.2018

03.05.2018
Projekt 1Aufgabe 201.05.201808.05.2018
Projekt 1Aufgabe 306.05.201812.05.2018
Projekt 2Aufgabe 128.04.201820.05.2018
Projekt 2Aufgabe 206.05.201825.05.2018

...

Code Block
languagejava
themeEclipse
firstline1
linenumberstrue
public class TimelineChartObject {
	private String y_category;
	private String x_category;
	private LocalDate start;
	private LocalDate end;

	public String getX_category() {
		return x_category;
	}

	public void setX_category(String x_category) {
		this.x_category = x_category;
	}

	public String getY_category() {
		return y_category;
	}

	public void setY_category(String y_category) {
		this.y_category = y_category;
	}

	public LocalDate getStart() {
		return start;
	}

	public void setStart(LocalDate start) {
		this.start = start;
	}

	public LocalDate getEnd() {
		return end;
	}

	public void setEnd(LocalDate end) {
		this.end = end;
	}
}

Anchor
Fill
Fill

Beispiel füllen der Daten:

Code Block
languagejava
themeEclipse
firstline1
linenumberstrue
//Erstellen Model
final ChartModel model = ChartModel.New()
	.addColumn(Column.New(Type.STRING, "project", "project"))
	.addColumn(Column.New(Type.STRING, "task", "Task"))
	.addColumn(Column.New(Type.DATE, "from", "From"))
	.addColumn(Column.New(Type.DATE, "to", "To"));

model.addRow("Project 1", "Aufgabe 1", LocalDate.of(2018, 4, 28), LocalDate.of(2018, 5, 3));
model.addRow("Project 1", "Aufgabe 2",LocalDate.of(2018, 5, 1), LocalDate.of(2018, 5, 8));
model.addRow("Project 1", "Aufgabe 3",LocalDate.of(2018, 5, 6), LocalDate.of(2018, 5, 12));
model.addRow("Project 2", "Aufgabe 1",LocalDate.of(2018, 4, 28), LocalDate.of(2018, 5, 20));
model.addRow("Project 2", "Aufgabe 2",LocalDate.of(2018, 5, 6), LocalDate.of(2018, 5, 25));
model.addRow("Project 2", "Aufgabe 3",LocalDate.of(2018, 5, 21), LocalDate.of(2018, 5, 28));
model.addRow("Project 2", "Aufgabe 4",LocalDate.of(2018, 6, 6), LocalDate.of(2018, 6, 12));
model.addRow("Project 3", "Aufgabe 1",LocalDate.of(2018, 6, 1), LocalDate.of(2018, 6, 10));
model.addRow("Project 4", "Aufgabe 1",LocalDate.of(2018, 5, 28), LocalDate.of(2018, 6, 6));

//Setzen des Models
timelineChart.setModel(model);


Anchor
Properties
Properties

API und Methoden:


Properties

AvoidOverlappingGridlines

Google Charts makes tiny adjustments to bar endpoints to avoid obscuring timeline gridlines. To prevent this behavior, set the avoidOverlappingGridLines option to false.

Code Block
languagejava
themeEclipse
linenumberstrue
timelineChart.setAvoidOverlappingGridLines(true);


CustomizeTimeline

Example

Code Block
languagejava
themeEclipse
linenumberstrue
final Timeline timeline = Timeline.Builder()
	.showRowLabels(true)
	.colorByRowLabel(true)
	.groupByRowLabel(true)
	.build();

this.timelineChart.setTimeline(timeline);