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 { ...@@ -138,9 +138,9 @@ public class StyleManager {
private Color errorBarsColor; private Color errorBarsColor;
// Formatting //////////////////////////////// // Formatting ////////////////////////////////
private String datePattern;
private Locale locale; private Locale locale;
private TimeZone timezone; private TimeZone timezone;
private String datePattern;
private String decimalPattern; private String decimalPattern;
/** /**
...@@ -223,9 +223,9 @@ public class StyleManager { ...@@ -223,9 +223,9 @@ public class StyleManager {
errorBarsColor = theme.getErrorBarsColor(); errorBarsColor = theme.getErrorBarsColor();
// Formatting //////////////////////////////// // Formatting ////////////////////////////////
datePattern = null; // if not null, this override pattern will be used
locale = Locale.getDefault(); locale = Locale.getDefault();
timezone = TimeZone.getDefault(); timezone = TimeZone.getDefault();
datePattern = null; // if not null, this override pattern will be used
decimalPattern = null; decimalPattern = null;
} }
...@@ -1047,21 +1047,6 @@ public class StyleManager { ...@@ -1047,21 +1047,6 @@ public class StyleManager {
// Formatting //////////////////////////////// // 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 * Set the locale to use for rendering the chart
* *
...@@ -1092,6 +1077,21 @@ public class StyleManager { ...@@ -1092,6 +1077,21 @@ public class StyleManager {
return timezone; 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 * Set the decimal formatter for all tick labels
* *
......
...@@ -114,7 +114,7 @@ public class NumberFormatter { ...@@ -114,7 +114,7 @@ public class NumberFormatter {
String decimalPattern; String decimalPattern;
if (styleManager.getDatePattern() == null) { if (styleManager.getDecimalPattern() == null) {
decimalPattern = getFormatPattern(value, min, max); decimalPattern = getFormatPattern(value, min, max);
} }
...@@ -140,12 +140,12 @@ public class NumberFormatter { ...@@ -140,12 +140,12 @@ public class NumberFormatter {
String decimalPattern; String decimalPattern;
if (styleManager.getDatePattern() == null) { if (styleManager.getDecimalPattern() == null) {
decimalPattern = "0E0"; decimalPattern = "0E0";
} }
else { else {
decimalPattern = styleManager.getDatePattern(); decimalPattern = styleManager.getDecimalPattern();
} }
DecimalFormat normalFormat = (DecimalFormat) numberFormat; 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