Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cewolf and Struts

Abebe Belew
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to integrate cewolf with a working struts app. and I am stuck.
I am not able to render a line chart in the jsp using this code but is seams to produce a bar chart if I change the chart type to verticalbar in the jsp,
what am I doing wrong? Please help. Below is code.


public class ViewChart implements DatasetProducer, Serializable {

public String[] categories;
private int[] values;
public String[] seriesNames;

public ViewChart(Map map) {

categories = new String[map.size()];
seriesNames = new String[map.size()];
values = new int[map.size()];
Iterator iter = map.keySet().iterator();
int count = 0;
String key =;
seriesNames[count] = key;
Double currentValue = (Double) map.get(key);
values[count] = currentValue.intValue();
categories[count] = " ";

public Object produceDataset(Map arg0) throws datasetProduceException {
DefaultCategoryDataset dataset = new DefaultCategoryDataset();

for (int i = 0; i < categories.length; i++) {
int currentValue = values[i];
dataset.addValue(currentValue, seriesNames[i], categories[i]);

return dataset;

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic