Skip to content
Snippets Groups Projects
Commit d7822de1 authored by Leonard Kupper's avatar Leonard Kupper
Browse files

Add diagram class for title and axis captions.

parent 07f7384a
No related branches found
No related tags found
2 merge requests!30Feat/guisvgplot integration 51,!28Bug/jar resource handling 49
......@@ -189,6 +189,9 @@ public final class App {
CategoricalPointListContainer<PointList> container = csvParser.parse(CsvType.X_ALIGNED_CATEGORIES, CsvOrientation.VERTICAL);
mLogger.debug("Internal data representation:\n {}", container.toString());
CategoricalBarChart barChart = new CategoricalBarChart(container);
barChart.setTitle("Beispieldiagramm");
barChart.setXAxisName("Gewicht in kg");
barChart.setYAxisName("Länge in m");
// Render diagram
MasterRenderer renderer = new MasterRenderer(indexV4Printer, a4Format);
......
......@@ -4,7 +4,6 @@ import de.tudresden.inf.mci.brailleplot.datacontainers.Named;
import de.tudresden.inf.mci.brailleplot.datacontainers.PointContainer;
import de.tudresden.inf.mci.brailleplot.datacontainers.PointList;
import de.tudresden.inf.mci.brailleplot.datacontainers.PointListContainer;
import de.tudresden.inf.mci.brailleplot.rendering.Renderable;
import java.util.List;
import java.util.Objects;
......@@ -15,7 +14,7 @@ import java.util.stream.Collectors;
* @author Richard Schmidt, Georg Graßnick
* @version 2019.09.02
*/
public class BarChart implements Renderable {
public class BarChart extends Diagram {
private PointListContainer<PointList> mData;
public BarChart(final PointListContainer<PointList> data) {
......
package de.tudresden.inf.mci.brailleplot.diagrams;
import de.tudresden.inf.mci.brailleplot.rendering.Renderable;
import java.util.Objects;
/**
* General representation of both scatter and line plots with basic data functions. Classes LinePlot and ScatterPlot extend this class.
* Implements Renderable.
*
* @author Richard Schmidt, Leonard Kupper
* @version 2019-09-12
*/
public class Diagram implements Renderable {
private String mTitle;
private String mXAxisName;
private String mYAxisName;
public final String getTitle() {
return mTitle;
}
public final void setTitle(final String title) {
this.mTitle = Objects.requireNonNull(title);
}
public final String getXAxisName() {
return mXAxisName;
}
public final void setXAxisName(final String xAxisName) {
this.mXAxisName = Objects.requireNonNull(xAxisName);
}
public final String getYAxisName() {
return mYAxisName;
}
public final void setYAxisName(final String yAxisName) {
this.mYAxisName = Objects.requireNonNull(yAxisName);
}
// public PointListList mP;
//
// /**
// * Getter for the minimum x-value.
// * @return double minimum x-value
// */
// public double getMinX() {
// return mP.getMinX();
// }
//
// /**
// * Getter for the maximum x-value.
// * @return double maximum x-value
// */
// public double getMaxX() {
// return mP.getMaxX();
// }
//
// /**
// * Getter for the minimum y-value.
// * @return double minimum y-value
// */
// public double getMinY() {
// return mP.getMinY();
// }
//
// /**
// * Getter for the maximum y-value.
// * @return double maximum y-value
// */
// public double getMaxY() {
// return mP.getMaxY();
// }
//
// /**
// * Getter for a data set by index.
// * @param index int
// * @return PointList with the corresponding data set
// */
// public PointListList.PointList getDataSet(final int index) {
// return (PointListList.PointList) mP.get(index);
// }
//
// /**
// * Getter for the name of a data set by index.
// * @param index int
// * @return name of the data set as a string
// */
// public String getDataSetName(final int index) {
// return mP.get(index).getName();
// }
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment