Skip to content

Commit

Permalink
solved minor issues..
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardodebenedictis committed Apr 9, 2018
1 parent 0be8aa5 commit d682d57
Showing 1 changed file with 6 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
import it.cnr.istc.lecture.api.Parameter;
import it.cnr.istc.lecture.desktopapp.Context.ParameterValue;
import java.net.URL;
import java.text.FieldPosition;
import java.text.NumberFormat;
import java.text.ParsePosition;
import java.util.HashMap;
import java.util.IdentityHashMap;
import java.util.Map;
Expand All @@ -39,6 +36,7 @@
import javafx.scene.layout.StackPane;
import javafx.util.StringConverter;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.DateAxis;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.fx.ChartViewer;
import org.jfree.chart.plot.CombinedDomainXYPlot;
Expand Down Expand Up @@ -103,24 +101,7 @@ private class StudentChartContext {
private final ChartViewer viewer;

private StudentChartContext(StudentContext ctx) {
final NumberAxis domain_axis = new NumberAxis("");
domain_axis.setAutoRangeIncludesZero(false);
domain_axis.setNumberFormatOverride(new NumberFormat() {
@Override
public StringBuffer format(double number, StringBuffer toAppendTo, FieldPosition pos) {
return format((long) number, toAppendTo, pos);
}

@Override
public StringBuffer format(long number, StringBuffer toAppendTo, FieldPosition pos) {
return toAppendTo.append(TIME_STRING_CONVERTER.toString(number));
}

@Override
public Number parse(String source, ParsePosition parsePosition) {
throw new UnsupportedOperationException("Not supported yet.");
}
});
DateAxis domain_axis = new DateAxis("");
CombinedDomainXYPlot plot = new CombinedDomainXYPlot(domain_axis);
plot.setGap(10.0);

Expand All @@ -132,7 +113,8 @@ public Number parse(String source, ParsePosition parsePosition) {
XYSeriesCollection collection = new XYSeriesCollection();
par_collections.put(par.name, collection);
par.properties.entrySet().forEach(c_par -> collection.addSeries(new XYSeries(c_par.getKey())));
NumberAxis range_axis = new NumberAxis("");
NumberAxis range_axis = new NumberAxis(par.name);
range_axis.setLabelAngle(1.5708);
final XYItemRenderer renderer = new StandardXYItemRenderer();
XYPlot c_plot = new XYPlot(collection, null, range_axis, renderer);
par_plots.put(par.name, c_plot);
Expand Down Expand Up @@ -161,7 +143,8 @@ public Number parse(String source, ParsePosition parsePosition) {
XYSeriesCollection collection = new XYSeriesCollection();
par_collections.put(par.name, collection);
par.properties.entrySet().forEach(c_par -> collection.addSeries(new XYSeries(c_par.getKey())));
NumberAxis range_axis = new NumberAxis("");
NumberAxis range_axis = new NumberAxis(par.name);
range_axis.setLabelAngle(1.5708);
final XYItemRenderer renderer = new StandardXYItemRenderer();
XYPlot c_plot = new XYPlot(collection, null, range_axis, renderer);
par_plots.put(par.name, c_plot);
Expand Down

0 comments on commit d682d57

Please sign in to comment.