Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cewolf data points not visible

 
vishal konnur
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am able to run the sample application (line chart) from the tutorial. But the charts do not show the data point on the lines.
any help is greatly appreciated.
thanks
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

Check the "Tutorial" link in the sample web app, and its associated tutorial.jsp page. It shows how to use a LineRendererProcessor postprocessor to highlight the individual data points.
 
vishal konnur
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I am sorry but i am not able to find the LineRendererProcessor example to display the datapoints.
I can display the charts just fine.
any help is greatly appreciated .. cewolf rocks!
thanks
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have the example web app? It comes with the cewolf download; see my signature for the link. It contains the tutorial.jsp page.
 
vishal konnur
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the tutorial.jsp includes tutorial_inc.jsp which does not use the postprocessor. (or maybe i am looking at the wrong code?)

My Jsp basically has this
<jsp:useBean id="analytics_day" class="de.laures.cewolf.example.PageViewCountDataDay" />
<cewolf:chart id="line" title="Banner Ad Day Statistics" type="line"
xaxislabel="Hour" yaxislabel="Views">
<cewolf:data>
<cewolf:producer id="analytics_day" />
</cewolf:data>
</cewolf:chart>
<cewolf:img chartid="line" renderer="/cewolf" width="400" height="300">

</cewolf:img>

Should my PageViewCountDataDay extend LineRendererProcessor ?
how and where should i use <cewolf:chartpostprocessor> to display the datapoint on the graph (with possibly a tooltip that will show the y-axis count)
thanks in advance


 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure what you're looking at; the example web app does not have a tutorial_inc.jsp file. Did you get cewolf from where I told you to get it?
 
vishal konnur
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ahhhhhhhhhhh
just found the example you were referring to .. its under ....\cewolf-1.1-ulf\cewolfexample-1.1
will go through it ..
thanks ulf!
 
vishal konnur
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your help! ..i was able to display the datapoints.
one more question .. how would i display the y-axis value on the tooltip ? (the views in tutorial.jsp)
I am trying to get it in generateToolTip(CategoryDataset arg0, int series, int arg2) {}
any ideas?
thanks again!

 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how would i display the y-axis value on the tooltip ? (the views in tutorial.jsp) I am trying to get it in generateToolTip(CategoryDataset arg0, int series, int arg2) {}

It's tricky for that example, because they Y values are random, and not stored anywhere in the PageViewCountData class. You'd need to store them as an instance variable, so that the generateToolTip method could get at them, and return them depending on "series" and "arg2".
 
vishal konnur
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi!
am still a little confused as to how i could call it
e.g
this is just static data but very similar to my implemenation.. the count is the Y Axis .. how would generateToolTip get called?
thanks again for your help!

public Object produceDataset(Map params) throws DatasetProduceException {

List customAnalyticsList = new ArrayList();

CustomAnalyticsItem item1 = new CustomAnalyticsItem();
CustomAnalyticsItem item2 = new CustomAnalyticsItem();
CustomAnalyticsItem item3 = new CustomAnalyticsItem();


item1.setCount(6744);
item1.setUrl("1001");
item1.setDate("0101");
customAnalyticsList.add(item1);

item2.setCount(2345);
item2.setUrl("1001");
item2.setDate("0102");
customAnalyticsList.add(item2);

item3.setCount(786);
item3.setUrl("1001");
item3.setDate("0103");
customAnalyticsList.add(item3);


DefaultCategoryDataset dataset = new DefaultCategoryDataset();
for(int i=0;i<customAnalyticsList.size();i++){
CustomAnalyticsItem item = (CustomAnalyticsItem)customAnalyticsList.get(i);
dataset.setValue(item.getCount(), item.getUrl(), item.getDate());
}

return dataset;
}
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't compiled or tested it, but this would be the gist of it for the PageViewCountData class:
 
vishal konnur
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
perfect ..
any idea why it wont work on firefox?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does "it won't work" mean? Tooltips in general work fine in Firefox, so you need to provide more detail about what, exactly, is or is not working.
 
vishal konnur
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure what happened , its working now! .. thanks a lot ulf you have been a great help

I had another question about passing parameters to the produceDataSet method in the class from the jsp
I have a dropdown in the jsp , on change should refresh the jsp with the new dataset but i need the value in the dropdown in produceDataSet Method to make pass it along to the backend.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure I understand the problem - during a form submit to the backend the current value of the dropdown would be submitted as well, so you could use it in the resulting JSP (and the cewolf dataset) as you please. Am I missing something?
 
vishal konnur
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not using a form currently.
Just like your example , i am using the jsp:usebean to point to my class , which calls the produceDataSet in the java class (makes db calls to get the dataset) and returns the dataset.
But now i need to pass in values to the produceDataSet method , basically a select box which will resubmit the form onchange of the select box (passing in the value selected).
I tried adding a form field to the jsp and capturing its value in the produceDataSet but its always null.

I can refactor the entire code to struts and am sure it'll work but trying to see if there is an easier way.
thanks again!
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm afraid I don't understand from your description what you're trying to do, especially how you might use a select box without using a form. Seeing all relevant code sure would help (make sure to keep it at minimum size if you do post code).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic