This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes spaces between categories in cewolf barchart Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "spaces between categories in cewolf barchart" Watch "spaces between categories in cewolf barchart" New topic

spaces between categories in cewolf barchart

vicky chauhan
Ranch Hand

Joined: Nov 27, 2008
Posts: 41

can anyone help me out...
how to control the spacing between categories in a vertical barchart..
bars in same category should be close to each other.. while there should be enough space between the end of one category and start of other category..

is there any jsp tag for that in cewolf...

please help
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41046
If you're using the cewolf distribution I maintain (it's linked in my signature), then you can use the BarRendererProcessor chart postprocessor to set the item margin of each bar; that moves the bars closer together or farther apart. It's demonstrated in the cewolfset.jsp page that's part of the cewolfexample web app that comes with the distribution; search for "barRenderer".

Ping & DNS - my free Android networking tools app
vicky chauhan
Ranch Hand

Joined: Nov 27, 2008
Posts: 41
I am not able to access your website for downloading the package.. i tried with chrome, mozilla, IE, but unable to.. it just shows either network timed out or a blank white page...

and could you please give an example of exact code here if possible..

and i asked a doubt in the morning also.. could you please check that post also.. it will be a great help for me..

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41046
The page is up, it must be a problem with your network access.

The JSP page I mentioned contains a full example of how to use the postprocessor.
vicky chauhan
Ranch Hand

Joined: Nov 27, 2008
Posts: 41
Thanks a lot, I got it from example... i downloaded it from sourceforge.. i am unable to access your page still though...

I am still having the following doubt about Map params usage:

I am making a webapplication which uses cewolf to generate barchart.

1) data for the barchart should come from produceDataset(Map params) - so i have kept all the code for accessing data from database there.

2) JSP using cewolf tags will create an instance of above dataproducer class and will call that function - will get the data from database - produce the chart - happy ending.......

3) problem is, i want a primary key (say username) based on which i will retrieve rows from database related to that key only... using session.setAttribute() i am able to pull that value till final jsp which is using cewolf.

BUT I AM NOT GETTING HOW TO PASS THIS VALUE TO produceDataset(Map params) ??

Need help on this... I know i have to set params to key value in jsp and using "Map params" have to retrieve that inside produceDataset function.. BUT I DONT KNOW HOW TO DO IT ??

could anyone show example code for doing this..
a) setting params to value i want to pass to produceDataset in JSP and to retrieve those params to use with database inside produceDataset method...
vicky chauhan
Ranch Hand

Joined: Nov 27, 2008
Posts: 41
I took the following code from the example you said: --------------------------------------------------------------------------

double min = 0;
double max = 260;
double val = 86;
double minCrit = 187;
double maxCrit = max;
double minWarn = 164;
double maxWarn = minCrit;
double maxNorm = minCrit;
double minNorm = min;

plot.setRange(new Range(min, max));

plot.addInterval(new MeterInterval("Normal",new Range(minNorm, maxNorm),, new BasicStroke(2.0f), null));

plot.addInterval(new MeterInterval("Warning",new Range(minWarn, maxWarn),Color.yellow, new BasicStroke(2.0f), null));

plot.addInterval(new MeterInterval("Critical",new Range(minCrit, maxCrit),, new BasicStroke(2.0f), null));


I am getting the following error:
java.lang.IllegalArgumentException raised:
Range(double,double):require lower(0.0) <= upper(-Infinity)

Could you tell what is the problem.
I agree. Here's the link:
subject: spaces between categories in cewolf barchart
Similar Threads
cewolf and Struts
cewolf - link/tooltip generator on area chart
How to generate charts using cewolf
Cewolf help !!
cewolfexample (cewolf-1.1-ulf)