Skip to content
Snippets Groups Projects
Commit 88dab491 authored by Tim Molter's avatar Tim Molter
Browse files

bug fix for issue #70 - NumberFormatter formatNumber() and formatLogNumber()...

bug fix for issue #70 - NumberFormatter formatNumber() and formatLogNumber() incorrectly uses styleManager.getDatePattern()
parent 1463ef39
No related branches found
No related tags found
No related merge requests found
......@@ -138,9 +138,9 @@ public class StyleManager {
private Color errorBarsColor;
// Formatting ////////////////////////////////
private String datePattern;
private Locale locale;
private TimeZone timezone;
private String datePattern;
private String decimalPattern;
/**
......@@ -223,9 +223,9 @@ public class StyleManager {
errorBarsColor = theme.getErrorBarsColor();
// Formatting ////////////////////////////////
datePattern = null; // if not null, this override pattern will be used
locale = Locale.getDefault();
timezone = TimeZone.getDefault();
datePattern = null; // if not null, this override pattern will be used
decimalPattern = null;
}
......@@ -1047,21 +1047,6 @@ public class StyleManager {
// Formatting ////////////////////////////////
/**
* Set the String formatter for Data x-axis
*
* @param pattern - the pattern describing the date and time format
*/
public void setDatePattern(String datePattern) {
this.datePattern = datePattern;
}
public String getDatePattern() {
return datePattern;
}
/**
* Set the locale to use for rendering the chart
*
......@@ -1092,6 +1077,21 @@ public class StyleManager {
return timezone;
}
/**
* Set the String formatter for Data x-axis
*
* @param pattern - the pattern describing the date and time format
*/
public void setDatePattern(String datePattern) {
this.datePattern = datePattern;
}
public String getDatePattern() {
return datePattern;
}
/**
* Set the decimal formatter for all tick labels
*
......
......@@ -114,7 +114,7 @@ public class NumberFormatter {
String decimalPattern;
if (styleManager.getDatePattern() == null) {
if (styleManager.getDecimalPattern() == null) {
decimalPattern = getFormatPattern(value, min, max);
}
......@@ -140,12 +140,12 @@ public class NumberFormatter {
String decimalPattern;
if (styleManager.getDatePattern() == null) {
if (styleManager.getDecimalPattern() == null) {
decimalPattern = "0E0";
}
else {
decimalPattern = styleManager.getDatePattern();
decimalPattern = styleManager.getDecimalPattern();
}
DecimalFormat normalFormat = (DecimalFormat) numberFormat;
......
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