aspose file tools*
The moose likes Other Open Source Projects and the fly likes Cewolf charts colors and Postprocessors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Cewolf charts colors and Postprocessors" Watch "Cewolf charts colors and Postprocessors" New topic
Author

Cewolf charts colors and Postprocessors

Levi Raymond
Greenhorn

Joined: Dec 08, 2008
Posts: 21
Hi Experts,

Please help with the following issues I am experiencing.

I am using the official stable cewolf distribution from sourceforge.net (cewolf 0.12.0) . I have been following a post on cewolf charts color and Ulf Dittimer suggested that we use his distribution cewolf-1.1-ulf.jar . Please help me solve the following issues when I try to use this distribution

1. The presentation of our reports on portal usage is meant to be white on white (White Color paint, white gradient paint and the actual chart on white background) as well as being able to add the actual number/count on top of
each series as in picture attached, which improves readability and quick interpretation.

2. On replaceing cewolf 0.12.0.jar with cewolf-1.1-ulf.jar I get a grey back ground represented by the time series chart attached.

First Question: Are there any tags or configurations I need to change the backdrop for the chart from grey in the time series image to white in the chart on white background image using cewolf-1.1-ulf.jar?
Second Question: What Do I need to do to get the reading of the series appear on top of the bars as in i chart on white background image?

Thanks



[Thumbnail for clean_bar_shot.png]


[Thumbnail for time_series.png]



SCJP5, SCWCD5
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42929
    
  68
It's possible that some default colors changed (inadvertently) from white to gray at some point. You can use the "backgroundcolor" and "plotbackgroundcolor" attributes to set chart color and plot color independently of one another.

Check out the BarRendererProcessor postprocessor for how to add labels to bars; there's no option to set the location of the labels, though. If you need fine-grained control over label placement, you could write your own postprocessor that sets the label positions precisely as you need them.
Levi Raymond
Greenhorn

Joined: Dec 08, 2008
Posts: 21
Thanks Ulf,

and on the issue of getting the bar chart to appear as sample image I attached earlier with the reading of the data item appearing on top of the the bar fro all data items?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42929
    
  68
Read my previous post :-) I guess I edited it after you did so.
Levi Raymond
Greenhorn

Joined: Dec 08, 2008
Posts: 21
Thanks a lot, I have managed to change the plot background and working on the labels. Still are there attributes yet for the plotborder and plotbordercolor. I still need to manipulate that to fulfill my requirements to have no borders at all around the plot (as in the bar chart attached earlieri).
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42929
    
  68
Check the docs for "bordervisible" and "bordercolor".
Levi Raymond
Greenhorn

Joined: Dec 08, 2008
Posts: 21
Thanks so much Ulf for you quick responses, I appreciate it.

I am trying to customise the appearance of my chart and I feel like there are some things I can control and some I cannot and there seems to be a few trade offs between cewolf-0.12.0 and cewolf-1.1-ulf. I have gone throught the tagdocs for cewolf-1.1-ulf and I understood your last repsonse. I always had these in my chartsnand "bordervisible" and bordercolor" are refering to the chart border which is fair enough. But then the actual plot still appears bordered and wanted to know if we can control this thus the question I posed earlier on if there were any attributes for the plot border itself. By setting the plotborderbackground to white makes us lose useful detail in bar and line charts. The grid in the background marking the yaxislabel/reading across the charts as depicted by the two images I attached is notably missing. And this is by just changing to cewolf-1.1-ulf so Can I also have control on the color of this feature.



[Thumbnail for cewolf-0.12.0.png]


[Thumbnail for cewolf-1.1-ul.png]

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42929
    
  68
I've uploaded a new version that introduces plotbordervisible and plotbordercolor attributes that are analogous to bordervisible and bordercolor for charts.
Levi Raymond
Greenhorn

Joined: Dec 08, 2008
Posts: 21
Fantastic. Thanks there again. Things are looking good on my side. I hope you managed too look at the last issue of the yaxis grid that appears on bar charts as an extension of the y-axis tickmarks into the chart making it easy for user to interpret the graph without specific readings. So given I have a white background and that grid (extension of tickmarks into chart) is white, I won't see it. I might need to be able to change the color to say, grey. And that will be it.

Thanks.
Levi Raymond
Greenhorn

Joined: Dec 08, 2008
Posts: 21
Hi Guys,

This is just a follow up on the issue above

I had requested earlier assistance on setting RangeGridlinePaint property of the plot.
Have you exposed any tags or attributed to assist in doing this yet?

I have tried again to create a custom post processor by implementing ChartPostProcessor that has the following subset of code:

CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot();
categoryplot.setBackgroundPaint(Color.white);
categoryplot.setRangeGridlinePaint(Color.lightGray);


In my jsp I have the follwing

<jsp:useBean id="postproducer" class="com.analytics.reports.business.CustomChartPostProcessor"/>


<%
pageContext.setAttribute("postproducer",
postproducer); %>


In cewof:chart tag..

<cewolf:data>
<cewolf:producer id="datasourceBottom" />
</cewolf:data>
<cewolf:colorpaint color="#FFFFFF" />

<cewolf:chartpostprocessor id="postproducer"/>



</cewolf:chart>



But still I fail to change anything. Please help on what I can do and what I can't do with this distribution of cewolf.
Bryan Meyer
Greenhorn

Joined: Nov 18, 2008
Posts: 6
Hey Levi:

I noticed that your post is almost a year old, but I thought I would respond anyhow. I too upgraded the Cewolf library in an application from Cewolf v0.12 to the current version v1.1.6 and had the same issue with the range gridline color.

First, I set the plot background to white using the plotbackgroundcolor attribute on the chart tag.
The range gridline color also seemed to be white. There's no attribute on the chart tag to change the color and after much digging, I found that a theme is applied to the charts in the methods in the ChartFactory class. First, the standard theme is created statically.
In my case, I was attempting to create a 3D bar chart. The createBarChart3D method sets the theme.
In the constructor method in the StandardChartTheme class, you'll see that the class variable rangeGridlinePaint is set to Color.white.
You could change the color there or create your own theme that inherits from the ChartTheme class.

Hope this helps!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cewolf charts colors and Postprocessors