Screenshots
Download Installer
User Manual
Support
Bug Tracking
Mailing List
Add-Ons
Address Update
FAQ
/** * Converts the x values of the series from years to month. * This function just divides the x values through 12. * * @param diagram: * The diagram containing the series to convert. */ function convertXValueFromYearsToMonth (diagram) { /* ======================================== */ // IMPORTS: importPackage(org.jfree.data.xy); // get the dataset var dataset = diagram.getChart().getXYPlot().getDataset(); var tempList = new LinkedList(); // convert all series of the dataset at the given positions for (var seriesIter = dataset.getSeries().iterator(); seriesIter.hasNext(); ){ /* ---------------------------------------- */ var series = seriesIter.next(); // clear and fill the template list with the new XYDataItems tempList.clear(); for (var itemIter = series.getItems().iterator(); itemIter.hasNext(); ) { var _item = itemIter.next(); tempList.add(new XYDataItem(_item.getXValue() / 12, _item.getYValue())); } // clear and fill the series with the items of the template list series.clear(); for (var itemIter = tempList.iterator(); itemIter.hasNext(); ) { series.add(itemIter.next()); } /* ---------------------------------------- */ } /* ======================================== */ }