Skip to content

Commit

Permalink
Update Abstract2DHistoChart.java
Browse files Browse the repository at this point in the history
  • Loading branch information
nicho92 authored Jan 3, 2024
1 parent 31ef622 commit a76c130
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package org.magic.gui.abstracts.charts;

import java.text.DecimalFormat;
import java.text.NumberFormat;

import org.jfree.chart.ChartFactory;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.data.time.TimeSeriesCollection;

public abstract class Abstract2DHistoChart<B> extends MTGUI2DChartComponent<B,TimeSeriesCollection> {
Expand All @@ -11,6 +15,11 @@ public abstract class Abstract2DHistoChart<B> extends MTGUI2DChartComponent<B,Ti
@Override
protected void createNewChart() {
chart = ChartFactory.createTimeSeriesChart(getTitle(), "Date", "Value", getDataSet(),showLegend(), true, false);

NumberFormat formatter = DecimalFormat.getInstance();
formatter.setMinimumFractionDigits(2);

((NumberAxis)chart.getXYPlot().getRangeAxis()).setNumberFormatOverride(formatter);
}

}
}

0 comments on commit a76c130

Please sign in to comment.