CombinedDomainCategory in charts

UI Components for JSF
jinio
Posts: 12
Joined: 21 May 2009, 13:53

21 May 2009, 14:05

hello everyone
I have ever worked with JFreeChart and Richfaces separatelly I just discovered primfaces and is very promising I think;
but I wonder is what I can see a combinedDomainCategry chart what I already used on JFreeChart?
thank you

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

21 May 2009, 14:15

Welcome to the forums, what is combinedDomainCategry exactly, can you provide a screenshot of the chart?

jinio
Posts: 12
Joined: 21 May 2009, 13:53

21 May 2009, 15:57

hi;
thank you for the fast replay;
I don't know how can I attach à screenshot here but I upload the screenshot in this link:
http://www.easy-share.com/1905296504/Co ... ryplot.png

thnk you

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

21 May 2009, 16:09

No out of the box solution but I think you can implement this by using two primefaces charts. One for p:lineChart and other one is for p:columnChart.

Place them like this;

Code: Select all

<p:lineChart />
<p:columnChart />

jinio
Posts: 12
Joined: 21 May 2009, 13:53

21 May 2009, 16:17

Thank you cagatay;
I will try that as soon as possible;
and I give you my impressions
best regards

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

21 May 2009, 16:43

Thanks, let us know :)

jinio
Posts: 12
Joined: 21 May 2009, 13:53

21 May 2009, 20:28

Hi;
great I can do it as you said;
I have just two problems:
1) how can I do to display the names of the graph within the graph? (I can't do that as explained in the skinning chapter of the primefaces_guide)
2)what I can do to control the window size of the graph displayed
thank you so much

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

22 May 2009, 02:31

Hi Jinio,

1) Do you mean the legends? For that please see the showcase demo as well;

LineChart: http://www.rehberharitam.com/prime-show ... eChart.jsf
ColumnChart: http://www.rehberharitam.com/prime-show ... nChart.jsf

Basically you need to provide the style as a javascript object since charts are flash based components.

Code: Select all

<script type="text/javascript">
			var chartStyle = {
				legend: {
					display:"right"
				}
			};
		</script>
2) The charts are displayed withing an html div element and the styleClass attribute applies to that div, it's the best place to control width and height;

Code: Select all

<style type="text/css">
			.column {
				width:600px;
				height:400px;
			}
</style>
You can use 1 and 2 in a chart like this:

Code: Select all

<p:columnChart value="#{chartBean.births}" var="birth" xfield="#{birth.year}" styleClass="column" style="chartStyle">
	<p:chartSeries label="Boys" value=" # {birth.boys}" />
	<p:chartSeries label="Girls" value=" # {birth.girls}" />
</p:columnChart>						
Hope this helps, also reference documentation and online demo can help to see how things work.

jinio
Posts: 12
Joined: 21 May 2009, 13:53

22 May 2009, 09:26

Great;
this is exactly what I'm searching;
a last question how can I fixe the scale of the yAxis for exemple to be Integer and only Integers betwen 0 and 2 for exemples (0,1 and 2)?
thank you so much

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

23 May 2009, 01:12

Jinio, see this topic for the axis range requirement you have: http://primefaces.prime.com.tr/forum/vi ... yaxis#p373

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 49 guests