ASF Bugzilla – Attachment 25403 Details for
Bug 49242
[PATCH] load LinkedDataRecord for Chart
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
diff.txt (text/plain), 2.93 KB, created by
Peter Kutak
on 2010-05-05 12:14:12 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Peter Kutak
Created:
2010-05-05 12:14:12 UTC
Size:
2.93 KB
patch
obsolete
>Index: src/scratchpad/src/org/apache/poi/hssf/usermodel/HSSFChart.java >=================================================================== >--- src/scratchpad/src/org/apache/poi/hssf/usermodel/HSSFChart.java (revision 940307) >+++ src/scratchpad/src/org/apache/poi/hssf/usermodel/HSSFChart.java (working copy) >@@ -38,6 +38,7 @@ > import org.apache.poi.hssf.record.formula.Area3DPtg; > import org.apache.poi.hssf.record.formula.Ptg; > >+import org.apache.poi.hssf.record.chart.LinkedDataRecord; > /** > * Has methods for construction of a chart object. > * >@@ -139,7 +140,7 @@ > public static HSSFChart[] getSheetCharts(HSSFSheet sheet) { > List charts = new ArrayList(); > HSSFChart lastChart = null; >- >+ HSSFSeries lastSeries = null; > // Find records of interest > List records = sheet.getSheet().getRecords(); > for(Iterator it = records.iterator(); it.hasNext();) { >@@ -155,6 +156,7 @@ > if(r instanceof SeriesRecord) { > HSSFSeries series = lastChart.new HSSFSeries( (SeriesRecord)r ); > lastChart.series.add(series); >+ lastSeries = series; > } > if(r instanceof ChartTitleFormatRecord) { > lastChart.chartTitleFormat = >@@ -173,6 +175,10 @@ > lastChart.chartTitleText = str; > } > } >+ if(r instanceof LinkedDataRecord) { >+ LinkedDataRecord data = (LinkedDataRecord)r; >+ lastSeries.insertData( data ); >+ } > } > > return (HSSFChart[]) >@@ -867,11 +873,30 @@ > public class HSSFSeries { > private SeriesRecord series; > private SeriesTextRecord seriesTitleText; >+ private LinkedDataRecord dataName; >+ private LinkedDataRecord dataValues; >+ private LinkedDataRecord dataCategoryLabels; >+ private LinkedDataRecord dataSecondaryCategoryLabels; >+ private int dataReaded = 0; > > /* package */ HSSFSeries(SeriesRecord series) { > this.series = series; > } > >+ public void insertData(LinkedDataRecord data){ >+ switch(dataReaded){ >+ case 0: dataName = data; >+ break; >+ case 1: dataValues = data; >+ break; >+ case 2: dataCategoryLabels = data; >+ break; >+ case 3: dataSecondaryCategoryLabels = data; >+ break; >+ } >+ dataReaded++; >+ } >+ > public short getNumValues() { > return series.getNumValues(); > } >@@ -905,5 +930,40 @@ > throw new IllegalStateException("No series title found to change"); > } > } >+ >+ /** >+ * @return record with data names >+ */ >+ public LinkedDataRecord getDataName(){ >+ return dataName; >+ } >+ >+ /** >+ * @return record with data values >+ */ >+ public LinkedDataRecord getDataValues(){ >+ return dataValues; >+ } >+ >+ /** >+ * @return record with data category labels >+ */ >+ public LinkedDataRecord getDataCategoryLabels(){ >+ return dataCategoryLabels; >+ } >+ >+ /** >+ * @return record with data secondary category labels >+ */ >+ public LinkedDataRecord getDataSecondaryCategoryLabels() { >+ return dataSecondaryCategoryLabels; >+ } >+ >+ /** >+ * @return record with series >+ */ >+ public SeriesRecord getSeries() { >+ return series; >+ } > } > }
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 49242
: 25403