• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Cewolf: How to handle the values on y axis

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
Im facing a problem in charts that
1. I want to divide the intervals on y-axis but in cewolf it is dividing by itself accordingly and it is not showing the value at the highest point as shown in the second image where the value of bar graph exceeds 40 but the intervals on y-axis is still showing as 40 ,i just want to display one more value above 40.
2.And how i can remove decimal points coming on y-axis as i dont want it in my charts as in case where i have taken days as count on y-axis and days may not be 1.3 ,2.6 etc i just want to control the values as per the requirement
please help me out if you have any idea about this
thanks





[BPS: Added project name to subject line]
[ December 01, 2008: Message edited by: Ben Souther ]
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

As to #1, you can write a ChartPostProcessor that sets the range on the axis to whatever values you see fit.

As to #2, are you using the cewolf distribution from SourceForge, or the one I distribute from the URL shown in my signature? If you're using my version (and you should), then the chart tag has a boolean axisinteger attribute you can use to achieve this. If you're using the official distribution then you need to write a ChartPostProcessor that sets integer tick units as the standard tick units.

The code for the post processors would look something like this:
 
shafiullah shaik
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply
This is the code which i have used for my charts.
Here i can able to give colors to my lines but how can i manage to set the values on y-axis as we are getting values from database(any values we can expect),the code which you have sent is hard coded to a particular range(0,50),here i dont know the range excatly what i want is to get complete values upto which the graph line reaches


<%
ChartPostProcessor dataColor = new ChartPostProcessor() {

public void processChart(Object chart, Map params) {
CategoryPlot plot = (CategoryPlot) ((JFreeChart) chart).getPlot();
for (int i = 0; i < params.size(); i++) {
String colorStr = (String) params.get(String.valueOf(i));
plot.getRenderer().setSeriesPaint(i, java.awt.Color.decode(colorStr));
}
}
};
pageContext.setAttribute("dataColor", dataColor);
%>

Displaying in the jsp using chartpostprocessor:
------------------------------------------------
<cewolf:chartpostprocessor id="dataColor">
<cewolf aram name="0" value='<%= "#000000" %>'/>
<cewolf aram name="1" value='<%= "#00FF00" %>'/>
<cewolf aram name="2" value='<%= "#990066" %>'/>
<cewolf aram name="3" value='<%= "#00FFFF" %>'/>
<cewolf aram name="4" value='<%= "#FF00FF" %>'/>
<cewolf aram name="5" value='<%= "#6600FF" %>'/>
<cewolf aram name="6" value='<%= "#990000" %>'/>
<cewolf aram name="7" value='<%= "#996600" %>'/>
<cewolf aram name="8" value='<%= "#99CC00" %>'/> </cewolf:chartpostprocessor>
could you please provide me any specified method if it is there to handle the values dynamically
find the image here:
----------------------


Please observe the above chart, if you didn't find the image open the url you will find an example chart
In the above chart first line in blue color exceeds the highest value shown in the graph ie 1500 ,how can i get the complete scale in order to cover the complete range.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree that this would be a nice feature for cewolf to have (or at least as an option), but it's not trivial. I'll look into it when I get a chance.
 
shafiullah shaik
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Iam using jfree charts but iam facing a problem in highlighting the point on the chart,as it is showing only the
line connecting points without highlighting the points

please help me regarding the same

see the difference between these charts one is showing simple line connecting the points but the other is highlighting the points

suggest me the code for highlighting those points

Iam using the following code:;
<cewolf:chart id="line" title="${title}"
type="line" showlegend="true" legendanchor="south"
xaxislabel="Months" yaxislabel="Associate Count" background="#FF030D" >
<cewolf:gradientpaint>
<cewolf:point color="#FF0000" y="200" x="2000"/>

</cewolf:gradientpaint>
<!--cewolf:colorpaint color="#B0C4DE"/-->

<cewolf:data>
<cewolf:producer id="pageViews" usecache="" />

</cewolf:data>

<cewolf:chartpostprocessor id="dataColor" >
<cewolf:param name="0" value='<%= "#000000" %>' />
<cewolf:param name="1" value='<%= "#00FF00" %>'/>
<cewolf:param name="2" value='<%= "#990066" %>'/>
<cewolf:param name="3" value='<%= "#00FFFF" %>'/>
<cewolf:param name="4" value='<%= "#FF00FF" %>'/>
<cewolf:param name="5" value='<%= "#6600FF" %>'/>
<cewolf:param name="6" value='<%= "#990000" %>'/>
<cewolf:param name="7" value='<%= "#996600" %>'/>
<cewolf:param name="8" value='<%= "#99CC00" %>'/>
</cewolf:chartpostprocessor>
</cewolf:chart>


<cewolf:img chartid="line" renderer="/cewolf" width="1046" height="700"
alt="">
<cewolf:map tooltipgeneratorid="pageViews" />
</cewolf:img>





waiting for your reply
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The cewolf distribution linked in my signature has a ChartPostProcessor that can be used to control the appearance of data points in category plots and XY plots. It's the de.laures.cewolf.cpp.LineRendererProcessor class.
 
shafiullah shaik
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much sir for your suggestion,I got succeded in developing the charts with data points.

In my current Application I am taking the count of number of projects on Y- axis but the intervals on Y-axis is divided by the API accordingly as Decimal values in few charts which I need to be a real value without decimal points.

Note:values are not predictable,it may be any value retreving from database.

Please suggest me for the same
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

I have used the code in your signature to dispaly integer values on X and Y axis for a stacked bar chart. Thanks for that, its working fine when deployed on weblogic server. But the same gives as error when deployed on Tomcat server (classnotfound Exception - as all classes, say dial pointer are not existing in the jar). Any help on how to resolve his issue?

Thanks,
Ana
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you add all jar files that come with the example web app to your web app's WEB-INF/lib directory?
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And welcome to Javaranch Ana!
 
Ana vincy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much. I replaced all the jars once again and its working.

Could you even please suggest how to dispaly the values on a stacked bar chart
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Could you even please suggest how to dispaly the values on a stacked bar chart


The "Cewolf Set" example page of the sample web app that comes with cewolf contains examples of horizontal and vertical, 2D and 3D, stacked bar charts.
 
Ana vincy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Current stackedVerticalBar chart appears as shown in your example. But I would like to display the corresponding data point on the bar as shown below
samplegraph.JPG
[Thumbnail for samplegraph.JPG]
Sample graph
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ana,
I've updated the cewolf distribution with an enhanced BarRenderer postprocessor that can be used to show item labels on (stacked) bar charts. That should address this issue.
 
Ana vincy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh! Thats great. Thanks a lot
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks to every one !! I am new to cewolf. This forum was of a great help. Once again Thanks a lot !!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic