提交 05830b2f 编写于 作者: S Serge Rider

#4209 Dashboard item render

上级 531220b6
......@@ -38,6 +38,8 @@ import org.jfree.data.time.TimeSeriesCollection;
import org.jfree.data.time.TimeSeriesDataItem;
import org.jfree.ui.RectangleEdge;
import org.jfree.ui.RectangleInsets;
import org.jkiss.dbeaver.ui.AWTUtils;
import org.jkiss.dbeaver.ui.UIStyles;
import org.jkiss.dbeaver.ui.dashboard.control.DashboardChartComposite;
import org.jkiss.dbeaver.ui.dashboard.control.DashboardRenderer;
import org.jkiss.dbeaver.ui.dashboard.model.DashboardContainer;
......@@ -72,12 +74,15 @@ public class DashboardRendererHistogram implements DashboardRenderer {
false);
histogramChart.setBorderVisible(false);
histogramChart.setPadding(new RectangleInsets(0, 0, 0, 0));
histogramChart.setTextAntiAlias(true);
histogramChart.setBackgroundPaint(AWTUtils.makeAWTColor(UIStyles.getDefaultTextBackground()));
//histogramChart.getLegend().setBorder(0, 0, 0, 0);
//histogramChart.removeLegend();
LegendTitle legend = histogramChart.getLegend();
legend.setPosition(RectangleEdge.BOTTOM);
legend.setBorder(0, 0, 0, 0);
legend.setBackgroundPaint(histogramChart.getBackgroundPaint());
//legend.setAnchor(Legend.EAST);
ChartPanel chartPanel = new ChartPanel( histogramChart );
......@@ -111,8 +116,7 @@ public class DashboardRendererHistogram implements DashboardRenderer {
// Set background
org.eclipse.swt.graphics.RGB swtBgColor = composite.getBackground().getRGB();
plot.setBackgroundPaint(new Color(swtBgColor.red, swtBgColor.green, swtBgColor.blue));
plot.setBackgroundPaint(AWTUtils.makeAWTColor(composite.getBackground()));
DashboardChartComposite chartComposite = new DashboardChartComposite(container, composite, SWT.NONE, preferredSize);
chartComposite.setChart(histogramChart);
......
package org.jkiss.dbeaver.ui;
import java.awt.*;
public class AWTUtils {
public static java.awt.Color makeAWTColor(org.eclipse.swt.graphics.Color src) {
org.eclipse.swt.graphics.RGB swtBgColor = src.getRGB();
return new Color(swtBgColor.red, swtBgColor.green, swtBgColor.blue);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册