diff --git a/src/main/java/org/gcube/portlets/admin/accountingmanager/client/filters/ActiveFiltersPanel.java b/src/main/java/org/gcube/portlets/admin/accountingmanager/client/filters/ActiveFiltersPanel.java index b650d39..c9d678e 100644 --- a/src/main/java/org/gcube/portlets/admin/accountingmanager/client/filters/ActiveFiltersPanel.java +++ b/src/main/java/org/gcube/portlets/admin/accountingmanager/client/filters/ActiveFiltersPanel.java @@ -536,7 +536,7 @@ public class ActiveFiltersPanel extends SimpleContainer { vlc.add(gridFilter, new VerticalLayoutData(1, 1, new Margins(0))); FieldSet fieldSet = new FieldSet(); - fieldSet.setHeight("480px"); + fieldSet.setHeight("450px"); fieldSet.setHeadingHtml("Active Filters"); fieldSet.setCollapsible(false); fieldSet.add(vlc); diff --git a/src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/job/JobChartTopPanel.java b/src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/job/JobChartTopPanel.java index e57f8b0..184cc46 100644 --- a/src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/job/JobChartTopPanel.java +++ b/src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/job/JobChartTopPanel.java @@ -6,6 +6,7 @@ import java.util.Date; import org.gcube.portlets.admin.accountingmanager.client.event.ExportRequestEvent; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ChartDateTimeData; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ChartTimeMeasure; +import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ColorsPalette; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.DownloadConstants; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.JobChartMeasure; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.TimeUnitMeasure; @@ -472,7 +473,11 @@ public class JobChartTopPanel extends SimpleContainer { * ); */ + ColorsPalette colorsPalette=new ColorsPalette(); ArrayString colors = options.colors(); + colors=colorsPalette.getColorsPalette(colors); + options.colors(colors); + // colors.setValue(0, "#cc0038"); // colors.setValue(1, "#32cd32"); @@ -949,43 +954,43 @@ public class JobChartTopPanel extends SimpleContainer { case Duration: return "[{" + " \"id\": \"" + JobChartMeasure.Duration.name() + "\"," + " \"labels\": {" + " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {" - + " \"color\": \"" + colors.get(1) + "\"" + " }" + " }," + " \"stackLabels\": {" + + " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\"," + " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \"" - + JobChartMeasure.Duration.getLabel() + "\"," + " \"style\": {" + " \"color\": \"" - + colors.get(1) + "\"" + " }" + " }" + "}]"; + + JobChartMeasure.Duration.getLabel() + "\"," + " \"style\": {" + " \"color\": \"#434348\"" + + " }" + " }" + "}]"; case MaxInvocationTime: return "[{" + " \"id\": \"" + JobChartMeasure.MaxInvocationTime.name() + "\"," + " \"labels\": {" + " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {" - + " \"color\": \"" + colors.get(1) + "\"" + " }" + " }," + " \"stackLabels\": {" + + " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\"," + " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \"" - + JobChartMeasure.MaxInvocationTime.getLabel() + "\"," + " \"style\": {" + " \"color\": \"" - + colors.get(1) + "\"" + " }" + " }" + "}]"; + + JobChartMeasure.MaxInvocationTime.getLabel() + "\"," + " \"style\": {" + " \"color\": \"#434348\"" + + " }" + " }" + "}]"; case MinInvocationTime: return "[{" + " \"id\": \"" + JobChartMeasure.MinInvocationTime.name() + "\"," + " \"labels\": {" + " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {" - + " \"color\": \"" + colors.get(1) + "\"" + " }" + " }," + " \"stackLabels\": {" + + " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\"," + " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \"" - + JobChartMeasure.MinInvocationTime.getLabel() + "\"," + " \"style\": {" + " \"color\": \"" - + colors.get(1) + "\"" + " }" + " }" + "}]"; + + JobChartMeasure.MinInvocationTime.getLabel() + "\"," + " \"style\": {" + " \"color\": \"#434348\"" + + " }" + " }" + "}]"; case OperationCount: return "[{" + " \"id\": \"" + JobChartMeasure.OperationCount.name() + "\"," + " \"labels\": { " - + " \"format\": \"{value}\"," + " \"style\": { " + " \"color\": \"" + colors.get(1) - + "\"" + " }" + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"style\": {" + + " \"format\": \"{value}\"," + " \"style\": { " + " \"color\": \"#434348\"" + + " }" + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\"," + " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \"" + JobChartMeasure.OperationCount.getLabel() + "\"," - + " \"style\": {" + " \"color\": \"" + colors.get(1) + "\"" + " }" + " }" + "}]"; + + " \"style\": {" + " \"color\": \"#434348\"" + " }" + " }" + "}]"; default: return "[{" + " \"id\": \"" + JobChartMeasure.Duration.name() + "\"," + " \"labels\": {" + " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {" - + " \"color\": \"" + colors.get(1) + "\"" + " }" + " }," + " \"stackLabels\": {" + + " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\"," + " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \"" - + JobChartMeasure.Duration.getLabel() + "\"," + " \"style\": {" + " \"color\": \"" - + colors.get(1) + "\"" + " }" + " }" + "}]"; + + JobChartMeasure.Duration.getLabel() + "\"," + " \"style\": {" + " \"color\": \"#434348\"" + + " }" + " }" + "}]"; } diff --git a/src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/service/ServiceChartTopPanel.java b/src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/service/ServiceChartTopPanel.java index 3aa7a6b..d138c1f 100644 --- a/src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/service/ServiceChartTopPanel.java +++ b/src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/service/ServiceChartTopPanel.java @@ -6,6 +6,7 @@ import java.util.Date; import org.gcube.portlets.admin.accountingmanager.client.event.ExportRequestEvent; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ChartDateTimeData; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ChartTimeMeasure; +import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ColorsPalette; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.DownloadConstants; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ServiceChartMeasure; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.TimeUnitMeasure; @@ -472,7 +473,11 @@ public class ServiceChartTopPanel extends SimpleContainer { * ); */ + ColorsPalette colorsPalette = new ColorsPalette(); ArrayString colors = options.colors(); + colors = colorsPalette.getColorsPalette(colors); + options.colors(colors); + // colors.setValue(0, "#cc0038"); // colors.setValue(1, "#32cd32"); @@ -1035,43 +1040,43 @@ public class ServiceChartTopPanel extends SimpleContainer { case Duration: return "[{" + " \"id\": \"" + ServiceChartMeasure.Duration.name() + "\"," + " \"labels\": {" + " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {" - + " \"color\": \"" + colors.get(1) + "\"" + " }" + " }," + " \"stackLabels\": {" + + " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\"," + " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \"" - + ServiceChartMeasure.Duration.getLabel() + "\"," + " \"style\": {" + " \"color\": \"" - + colors.get(1) + "\"" + " }" + " }" + "}]"; + + ServiceChartMeasure.Duration.getLabel() + "\"," + " \"style\": {" + + " \"color\": \"#434348\"" + " }" + " }" + "}]"; case MaxInvocationTime: return "[{" + " \"id\": \"" + ServiceChartMeasure.MaxInvocationTime.name() + "\"," + " \"labels\": {" + " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {" - + " \"color\": \"" + colors.get(1) + "\"" + " }" + " }," + " \"stackLabels\": {" + + " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\"," + " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \"" + ServiceChartMeasure.MaxInvocationTime.getLabel() + "\"," + " \"style\": {" - + " \"color\": \"" + colors.get(1) + "\"" + " }" + " }" + "}]"; + + " \"color\": \"#434348\"" + " }" + " }" + "}]"; case MinInvocationTime: return "[{" + " \"id\": \"" + ServiceChartMeasure.MinInvocationTime.name() + "\"," + " \"labels\": {" + " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {" - + " \"color\": \"" + colors.get(1) + "\"" + " }" + " }," + " \"stackLabels\": {" + + " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\"," + " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \"" + ServiceChartMeasure.MinInvocationTime.getLabel() + "\"," + " \"style\": {" - + " \"color\": \"" + colors.get(1) + "\"" + " }" + " }" + "}]"; + + " \"color\": \"#434348\"" + " }" + " }" + "}]"; case OperationCount: return "[{" + " \"id\": \"" + ServiceChartMeasure.OperationCount.name() + "\"," + " \"labels\": { " - + " \"format\": \"{value}\"," + " \"style\": { " + " \"color\": \"" + colors.get(1) - + "\"" + " }" + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"style\": {" + + " \"format\": \"{value}\"," + " \"style\": { " + " \"color\": \"#434348\"" + " }" + + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\"," + " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \"" + ServiceChartMeasure.OperationCount.getLabel() + "\"," - + " \"style\": {" + " \"color\": \"" + colors.get(1) + "\"" + " }" + " }" + "}]"; + + " \"style\": {" + " \"color\": \"#434348\"" + " }" + " }" + "}]"; default: return "[{" + " \"id\": \"" + ServiceChartMeasure.Duration.name() + "\"," + " \"labels\": {" + " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {" - + " \"color\": \"" + colors.get(1) + "\"" + " }" + " }," + " \"stackLabels\": {" + + " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\"," + " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \"" - + ServiceChartMeasure.Duration.getLabel() + "\"," + " \"style\": {" + " \"color\": \"" - + colors.get(1) + "\"" + " }" + " }" + "}]"; + + ServiceChartMeasure.Duration.getLabel() + "\"," + " \"style\": {" + + " \"color\": \"#434348\"" + " }" + " }" + "}]"; } diff --git a/src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/storage/StorageChartTopPanel.java b/src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/storage/StorageChartTopPanel.java index e07cedf..0185f7e 100644 --- a/src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/storage/StorageChartTopPanel.java +++ b/src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/storage/StorageChartTopPanel.java @@ -7,6 +7,7 @@ import org.gcube.portlets.admin.accountingmanager.client.event.ExportRequestEven import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ByteUnitMeasure; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ChartDateTimeData; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ChartTimeMeasure; +import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ColorsPalette; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.DownloadConstants; import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.StorageChartMeasure; import org.gcube.portlets.admin.accountingmanager.client.resource.AccountingManagerResources; @@ -451,7 +452,11 @@ public class StorageChartTopPanel extends SimpleContainer { * ); */ + ColorsPalette colorsPalette = new ColorsPalette(); ArrayString colors = options.colors(); + colors = colorsPalette.getColorsPalette(colors); + options.colors(colors); + // colors.setValue(0, "#cc0038"); // colors.setValue(1, "#32cd32"); @@ -878,28 +883,28 @@ public class StorageChartTopPanel extends SimpleContainer { case DataVolume: return "[{" + " \"id\": \"" + StorageChartMeasure.DataVolume.name() + "\"," + " \"labels\": {" + " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {" - + " \"color\": \"" + colors.get(1) + "\"" + " }" + " }," + " \"stackLabels\": {" + + " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\"," + " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \"" - + StorageChartMeasure.DataVolume.getLabel() + "\"," + " \"style\": {" + " \"color\": \"" - + colors.get(1) + "\"" + " }" + " }" + "}]"; + + StorageChartMeasure.DataVolume.getLabel() + "\"," + " \"style\": {" + + " \"color\": \"#434348\"" + " }" + " }" + "}]"; case OperationCount: return "[{" + " \"id\": \"" + StorageChartMeasure.OperationCount.name() + "\"," + " \"labels\": { " - + " \"format\": \"{value}\"," + " \"style\": { " + " \"color\": \"" + colors.get(1) - + "\"" + " }" + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"style\": {" + + " \"format\": \"{value}\"," + " \"style\": { " + " \"color\": \"#434348\"" + " }" + + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\"," + " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \"" + StorageChartMeasure.OperationCount.getLabel() + "\"," - + " \"style\": {" + " \"color\": \"" + colors.get(1) + "\"" + " }" + " }" + "}]"; + + " \"style\": {" + " \"color\": \"#434348\"" + " }" + " }" + "}]"; default: return "[{" + " \"id\": \"" + StorageChartMeasure.DataVolume.name() + "\"," + " \"labels\": {" + " \"format\": \"{value} " + unitMeasureLabel + "\"," + " \"style\": {" - + " \"color\": \"" + colors.get(1) + "\"" + " }" + " }," + " \"stackLabels\": {" + + " \"color\": \"#434348\"" + " }" + " }," + " \"stackLabels\": {" + " \"enabled\": \"true\"," + " \"style\": {" + " \"fontWeight\": \"bold\"," + " \"color\": \"gray\"" + " } " + " }," + " \"title\": { " + " \"text\": \"" - + StorageChartMeasure.DataVolume.getLabel() + "\"," + " \"style\": {" + " \"color\": \"" - + colors.get(1) + "\"" + " }" + " }" + "}]"; + + StorageChartMeasure.DataVolume.getLabel() + "\"," + " \"style\": {" + + " \"color\": \"#434348\"" + " }" + " }" + "}]"; } diff --git a/src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/utils/ColorsPalette.java b/src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/utils/ColorsPalette.java new file mode 100644 index 0000000..071eb34 --- /dev/null +++ b/src/main/java/org/gcube/portlets/admin/accountingmanager/client/maindata/charts/utils/ColorsPalette.java @@ -0,0 +1,35 @@ +package org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils; + +import com.github.highcharts4gwt.model.array.api.ArrayString; + +/** + * + * @author Giancarlo Panichi + * + */ +public class ColorsPalette { + + private String[] palette = { "#87CEEB", "#DAA520", "#3CB371", "#FF4500", "#8FBC8F", "#FF00FF", "#BDB76B", "#5F9EA0", + "#A0522D", "#6B8E23", "#FFA07A", "#696969", "#DDA0DD", "#C71585", "#1E90FF", "#D2B48C", "#90EE90", + "#B22222", "#00CED1", "#9400D3", "#FFDAB9", "#663399", "#FFE4C4", "#ADFF2F", "#FF0000", "#00FFFF", + "#483D8B", "#FFFF00", "#00008B", "#FFDEAD", "#7CFC00", "#FF6347", "#AFEEEE", "#6A5ACD", "#FFFACD", + "#0000CD", "#F5DEB3", "#00FF00", "#FF7F50", "#7FFFD4", "#7B68EE", "#FFEFD5", "#0000FF", "#DEB887", + "#32CD32", "#FFA500", "#40E0D0", "#9370DB", "#FFE4B5", "#4169E1", "#BC8F8F", "#98FB98", "#8B0000", + "#48D1CC", "#800080", "#EEE8AA", "#00BFFF", "#F4A460", "#00FA9A", "#800000", "#556B2F", "#8A2BE2", + "#F0E68C", "#6495ED", "#B8860B", "#2E8B57", "#FFD700", "#66CDAA", "#9932CC", "#FFC0CB", "#87CEFA", + "#CD853F", "#228B22", "#DC143C", "#20B2AA", "#BA55D3", "#FFB6C1", "#B0E0E6", "#D2691E", "#008000", + "#CD5C5C", "#008B8B", "#FF00FF", "#FF69B4", "#B0C4DE", "#808000", "#006400", "#F08080", "#008080", + "#EE82EE", "#FF1493", "#4682B4", "#8B4513", "#9ACD32", "#FA8072", "#778899", "#DA70D6", "#DB7093" }; + + public ColorsPalette() { + + } + + public ArrayString getColorsPalette(ArrayString colors) { + for (int i = 0; i < palette.length; i++) { + colors.setValue(i, palette[i]); + } + colors.setLength(palette.length); + return colors; + } +} diff --git a/src/main/java/org/gcube/portlets/admin/accountingmanager/shared/Constants.java b/src/main/java/org/gcube/portlets/admin/accountingmanager/shared/Constants.java index 2422cf9..2f07d58 100644 --- a/src/main/java/org/gcube/portlets/admin/accountingmanager/shared/Constants.java +++ b/src/main/java/org/gcube/portlets/admin/accountingmanager/shared/Constants.java @@ -50,7 +50,7 @@ public class Constants { //Top Number public static final int TOP_NUMBER_DEFAULT = 10; - public static final int TOP_NUMBER_MAX = 50; + public static final int TOP_NUMBER_MAX = 100; public static final int TOP_NUMBER_MIN = 1;