Hardcoded Y-axis value

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
rvijaiganesh
Posts: 19
Joined: Wed Mar 09, 2011 2:11 pm
antibot: No, of course not.

Hardcoded Y-axis value

Post by rvijaiganesh » Thu Mar 10, 2011 2:24 pm

Hi,

I need to set the constant Y-axis value in the stackedBarchart like(0,33.3%,66.7%,100% to 300% on left side y-axis and 0,1,2,3,4 to 10 on the ride side y axis).

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: Hardcoded Y-axis value

Post by paradoxoff » Thu Mar 10, 2011 9:25 pm

Code: Select all

NumberAxis yAxis = new NumberAxis("y axis");
yAxis.setTickUnit(new NumberTickUnit(0.3333, DecimalFormat.getPercentInstance()));
yAxis.setRange(new Range(0, 3));
A similar approach works for the 1-10 tick range.

Locked