如何删除背景图案? [英] How to remove the background's pattern?

查看:123
本文介绍了如何删除背景图案?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起,我不知道它是什么,所以我可能问了一个不清楚的问题,但我希望所附的图像能对它有所解释.我圈了我要删除的区域.我只需要整个背景具有一种连续的颜色,无论是灰色还是其他任何颜色.

I'm sorry I don't know what it is so I may have asked an unclear question but I hope the attached images explains it. I circled the areas I need to remove. I simply need the whole background to have one continuous color whether it's gray or anything else.

这是我用来生成图表的代码段:

Here is the piece of code I use to generate the chart:

final JFreeChart chart = ChartFactory.createTimeSeriesChart(generateTitle(title, resultsCount), xAxis, yAxis,
                (XYDataset) paramCategoryDataset, true, false, false);
  final XYPlot plot = chart.getXYPlot();
  plot.setNoDataMessage(MSG_NO_DATA);
  plot.setBackgroundPaint(Color.LIGHT_GRAY); //I need the BG to be plain gray.

  SymbolAxis localSymbolAxis1 = new SymbolAxis("Domain", new String[] { "Failure", "Success", "Failure", "Success", "Failure", "Success" });
  plot.setRangeAxis(localSymbolAxis1);
  XYStepRenderer localXYStepRenderer = new XYStepRenderer();
  localXYStepRenderer.setBaseFillPaint(Color.white);
  localXYStepRenderer.setUseFillPaint(true);
  localXYStepRenderer.setBaseShape(ShapeUtilities.createDiamond(2f));
  localXYStepRenderer.setAutoPopulateSeriesShape(false);
  localXYStepRenderer.setAutoPopulateSeriesStroke(false);
  localXYStepRenderer.setDataBoundsIncludesVisibleSeriesOnly(false);
  plot.setRenderer(localXYStepRenderer);

这是显示需要在弯曲矩形内移除的图像:

And here is the image showing what I need to remove within in curved rectangles:

但是,让我问另一个贪婪的问题.有没有办法让我的阶梯图线恰好位于那些高亮区域之一,而不是让它的一半在黑暗的部分而另一半在较亮的部分?

But let me ask another greedy question. Is there a way to have my step graph line right in one of those hilighted areas instead of having half of it in the dark part and the other half in the lighter part ?

推荐答案

要获得连续的背景色,可以将网格线的可见性设置为false.

To get a continuous background color, you can set the gridlines' visibility to false.

plot.setDomainGridlinesVisible(false);
plot.setRangeGridlinesVisible(false);

或者,您可以设置绘图的背景颜色以匹配网格线.

Alternatively, you can set the plot's background color to match the gridlines.

附录:我的意思是背景中的明暗区域.

啊,您希望交替的浅灰色和中灰色区域是单一的灰色阴影.试试这个:

Ah, you want the alternating light- and medium-gray areas to be a single shade of gray. Try this:

symbolAxis.setGridBandsVisible(false);

这篇关于如何删除背景图案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆