feature/21354 #3

Merged
giancarlo.panichi merged 6 commits from feature/21354 into master 2021-11-30 14:36:40 +01:00
6 changed files with 89 additions and 39 deletions
Showing only changes of commit 8e68cdcf4b - Show all commits

View File

@ -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("<b>Active Filters</b>");
fieldSet.setCollapsible(false);
fieldSet.add(vlc);

View File

@ -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\""
+ " }" + " }" + "}]";
}

View File

@ -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\"" + " }" + " }" + "}]";
}

View File

@ -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\"" + " }" + " }" + "}]";
}

View File

@ -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;
}
}

View File

@ -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;