ASF Bugzilla – Attachment 27039 Details for
Bug 51196
[PATCH] Patch to simplify XSSFChart creation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for ScatterChart example and formatAsString() method
patch.txt (text/plain), 2.86 KB, created by
Roman Kashitsyn
on 2011-05-20 13:34:57 UTC
(
hide
)
Description:
Patch for ScatterChart example and formatAsString() method
Filename:
MIME Type:
Creator:
Roman Kashitsyn
Created:
2011-05-20 13:34:57 UTC
Size:
2.86 KB
patch
obsolete
>Index: src/java/org/apache/poi/ss/util/CellRangeAddress.java >=================================================================== >--- src/java/org/apache/poi/ss/util/CellRangeAddress.java (revision 1125291) >+++ src/java/org/apache/poi/ss/util/CellRangeAddress.java (working copy) >@@ -17,6 +17,7 @@ > > package org.apache.poi.ss.util; > >+import org.apache.poi.ss.formula.SheetNameFormatter; > import org.apache.poi.hssf.record.RecordInputStream; > import org.apache.poi.hssf.record.SelectionRecord; > import org.apache.poi.util.LittleEndianByteArrayOutputStream; >@@ -89,7 +90,7 @@ > public String formatAsString(String sheetName, boolean useAbsoluteAddress) { > StringBuffer sb = new StringBuffer(); > if (sheetName != null) { >- sb.append(sheetName); >+ sb.append(SheetNameFormatter.format(sheetName)); > sb.append("!"); > } > CellReference cellRefFrom = new CellReference(getFirstRow(), getFirstColumn(), >Index: src/examples/src/org/apache/poi/xssf/usermodel/examples/ScatterChart.java >=================================================================== >--- src/examples/src/org/apache/poi/xssf/usermodel/examples/ScatterChart.java (revision 1125291) >+++ src/examples/src/org/apache/poi/xssf/usermodel/examples/ScatterChart.java (working copy) >@@ -37,7 +37,7 @@ > public static void main(String[]args) throws Exception { > Workbook wb = new XSSFWorkbook(); > CreationHelper creationHelper = wb.getCreationHelper(); >- Sheet sheet = wb.createSheet("new sheet"); >+ Sheet sheet = wb.createSheet("Sheet 1"); > final int NUM_OF_ROWS = 3; > final int NUM_OF_COLUMNS = 10; > >@@ -57,7 +57,7 @@ > > Chart chart = drawing.createChart(anchor); > ChartLegend legend = chart.getOrCreateLegend(); >- legend.setPosition(LegendPosition.RIGHT); >+ legend.setPosition(LegendPosition.TOP_RIGHT); > > ScatterChartData data = chart.getChartDataFactory().createScatterChartData(); > >@@ -65,12 +65,12 @@ > ValueAxis leftAxis = chart.getChartAxisFactory().createValueAxis(AxisPosition.LEFT); > > ScatterChartSerie firstSerie = data.addSerie(); >- firstSerie.setXValues(sheet, new CellRangeAddress(0, 0, NUM_OF_COLUMNS + 1, NUM_OF_COLUMNS + 1)); >- firstSerie.setYValues(sheet, new CellRangeAddress(1, 1, NUM_OF_COLUMNS + 1, NUM_OF_COLUMNS + 1)); >+ firstSerie.setXValues(sheet, new CellRangeAddress(0, 0, 0, NUM_OF_COLUMNS - 1)); >+ firstSerie.setYValues(sheet, new CellRangeAddress(1, 1, 0, NUM_OF_COLUMNS - 1)); > > ScatterChartSerie secondSerie = data.addSerie(); >- secondSerie.setXValues(sheet, new CellRangeAddress(0, 0, NUM_OF_COLUMNS + 1, NUM_OF_COLUMNS + 1)); >- secondSerie.setYValues(sheet, new CellRangeAddress(2, 2, NUM_OF_COLUMNS + 1, NUM_OF_COLUMNS + 1)); >+ secondSerie.setXValues(sheet, new CellRangeAddress(0, 0, 0, NUM_OF_COLUMNS - 1)); >+ secondSerie.setYValues(sheet, new CellRangeAddress(2, 2, 0, NUM_OF_COLUMNS - 1)); > > chart.plot(data, bottomAxis, leftAxis); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 51196
:
26995
|
26996
|
27004
|
27021
|
27033
| 27039 |
27077
|
27294
|
27445