aspose file tools*
The moose likes Struts and the fly likes cewolf and Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "cewolf and Struts" Watch "cewolf and Struts" New topic
Author

cewolf and Struts

Abebe Belew
Greenhorn

Joined: Jul 21, 2004
Posts: 19
Hellow,
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.

datasetProducer

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;
while(iter.hasNext()){
String key = iter.next().toString();
seriesNames[count] = key;
Double currentValue = (Double) map.get(key);
values[count] = currentValue.intValue();
categories[count] = " ";
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;
}


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cewolf and Struts