Dual Y axis changes

"Chris McKay" <[email protected]> Thu, 1 Jul 2004 14:15:36 +1200
Newsgroups gmane.comp.krysalis.jcharts.devel
Message-ID <006101c45f11$4f9c90c0$0300000a@Chris>
I've added in the changes required for a RHS Y Axis. At present only a
LineChart can be rendered against the RHS, let me know what should be
priorities for other charts. Not sure where to add the documentation but
looking at the Test driver should make things clear. Here are some
additional comments.


There is new constructor for a DataSeries which includes the right hand
side axis title:
        dataSeries = new DataSeries(axisLabels, " ", "Total Backup
Events", "Success Percentage",  null);

Then there is a RHS AxisTypeProperties class that can have all the usual
properties set. You can have an automatic scale and a user defined
scale:
	
axisProperties.getRightYAxisProperties().setShowAxis(true);
		((DataAxisProperties)
axisProperties.getRightYAxisProperties()).setNumItems(5); 
		((DataAxisProperties)
axisProperties.getRightYAxisProperties()).setUserDefinedScale(0, 25);
		// RHS axis look and feel
	
axisProperties.getRightYAxisProperties().setTitleChartFont(axisTitleFont
);
	
axisProperties.getRightYAxisProperties().setScaleChartFont(axisScaleFont
);
	
axisProperties.getRightYAxisProperties().setAxisTitleChartFont(axisTitle
Font);
	
axisProperties.getRightYAxisProperties().setPaddingBetweenAxisTitleAndLa
bels(3);
	
axisProperties.getRightYAxisProperties().setTitleChartFont(axisTitleFont
);

Then new constructor to the DataSet so that you can signify that this
set of data should be plotted against the RHS scale:
        axisChartDataSet = new AxisChartDataSet(lineData, true,
lineLegendLabels, linePaints, ChartType.LINE, lineChartProperties);

That's it - hope I haven't broken anything!

C




-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com