View | Details | Raw Unified | Return to bug 51196
Collapse All | Expand All

(-)src/java/org/apache/poi/ss/util/CellRangeAddress.java (-1 / +2 lines)
Lines 17-22 Link Here
17
17
18
package org.apache.poi.ss.util;
18
package org.apache.poi.ss.util;
19
19
20
import org.apache.poi.ss.formula.SheetNameFormatter;
20
import org.apache.poi.hssf.record.RecordInputStream;
21
import org.apache.poi.hssf.record.RecordInputStream;
21
import org.apache.poi.hssf.record.SelectionRecord;
22
import org.apache.poi.hssf.record.SelectionRecord;
22
import org.apache.poi.util.LittleEndianByteArrayOutputStream;
23
import org.apache.poi.util.LittleEndianByteArrayOutputStream;
Lines 89-95 Link Here
89
    public String formatAsString(String sheetName, boolean useAbsoluteAddress) {
90
    public String formatAsString(String sheetName, boolean useAbsoluteAddress) {
90
        StringBuffer sb = new StringBuffer();
91
        StringBuffer sb = new StringBuffer();
91
        if (sheetName != null) {
92
        if (sheetName != null) {
92
            sb.append(sheetName);
93
            sb.append(SheetNameFormatter.format(sheetName));
93
            sb.append("!");
94
            sb.append("!");
94
        }
95
        }
95
        CellReference cellRefFrom = new CellReference(getFirstRow(), getFirstColumn(),
96
        CellReference cellRefFrom = new CellReference(getFirstRow(), getFirstColumn(),
(-)src/examples/src/org/apache/poi/xssf/usermodel/examples/ScatterChart.java (-6 / +6 lines)
Lines 37-43 Link Here
37
	public static void main(String[]args) throws Exception {
37
	public static void main(String[]args) throws Exception {
38
		Workbook wb = new XSSFWorkbook();
38
		Workbook wb = new XSSFWorkbook();
39
		CreationHelper creationHelper = wb.getCreationHelper();
39
		CreationHelper creationHelper = wb.getCreationHelper();
40
		Sheet sheet = wb.createSheet("new sheet");
40
		Sheet sheet = wb.createSheet("Sheet 1");
41
		final int NUM_OF_ROWS = 3;
41
		final int NUM_OF_ROWS = 3;
42
		final int NUM_OF_COLUMNS = 10;
42
		final int NUM_OF_COLUMNS = 10;
43
43
Lines 57-63 Link Here
57
57
58
		Chart chart = drawing.createChart(anchor);
58
		Chart chart = drawing.createChart(anchor);
59
		ChartLegend legend = chart.getOrCreateLegend();
59
		ChartLegend legend = chart.getOrCreateLegend();
60
		legend.setPosition(LegendPosition.RIGHT);
60
		legend.setPosition(LegendPosition.TOP_RIGHT);
61
61
62
		ScatterChartData data = chart.getChartDataFactory().createScatterChartData();
62
		ScatterChartData data = chart.getChartDataFactory().createScatterChartData();
63
63
Lines 65-76 Link Here
65
		ValueAxis leftAxis = chart.getChartAxisFactory().createValueAxis(AxisPosition.LEFT);
65
		ValueAxis leftAxis = chart.getChartAxisFactory().createValueAxis(AxisPosition.LEFT);
66
66
67
		ScatterChartSerie firstSerie = data.addSerie();
67
		ScatterChartSerie firstSerie = data.addSerie();
68
		firstSerie.setXValues(sheet, new CellRangeAddress(0, 0, NUM_OF_COLUMNS + 1, NUM_OF_COLUMNS + 1));
68
		firstSerie.setXValues(sheet, new CellRangeAddress(0, 0, 0, NUM_OF_COLUMNS - 1));
69
		firstSerie.setYValues(sheet, new CellRangeAddress(1, 1, NUM_OF_COLUMNS + 1, NUM_OF_COLUMNS + 1));
69
		firstSerie.setYValues(sheet, new CellRangeAddress(1, 1, 0, NUM_OF_COLUMNS - 1));
70
70
71
		ScatterChartSerie secondSerie = data.addSerie();
71
		ScatterChartSerie secondSerie = data.addSerie();
72
		secondSerie.setXValues(sheet, new CellRangeAddress(0, 0, NUM_OF_COLUMNS + 1, NUM_OF_COLUMNS + 1));
72
		secondSerie.setXValues(sheet, new CellRangeAddress(0, 0, 0, NUM_OF_COLUMNS - 1));
73
		secondSerie.setYValues(sheet, new CellRangeAddress(2, 2, NUM_OF_COLUMNS + 1, NUM_OF_COLUMNS + 1));
73
		secondSerie.setYValues(sheet, new CellRangeAddress(2, 2, 0, NUM_OF_COLUMNS - 1));
74
74
75
		chart.plot(data, bottomAxis, leftAxis);
75
		chart.plot(data, bottomAxis, leftAxis);
76
76

Return to bug 51196