Hi Team,
Actually i am adding a chart shape and then after adding some text in chart shape i am trying to change the color of few words but colored word is getting added twice . it was working fine is aspose 8.6 but broken in aspose 24.1
below is my code
package com.live.test;
import com.aspose.cells.Cells;
import com.aspose.cells.Chart;
import com.aspose.cells.ChartType;
import com.aspose.cells.Color;
import com.aspose.cells.Font;
import com.aspose.cells.Shape;
import com.aspose.cells.Workbook;
import com.aspose.cells.Worksheet;
public class AsposeChartGenerate {
public static void main(String[] args) throws Exception {
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.getWorksheets().get(0);
int chartIndex = worksheet.getCharts().add(ChartType.COLUMN, 5, 0, 15, 5);
Chart waterfallChart = worksheet.getCharts().get(chartIndex);
Cells cells = worksheet.getCells();
cells.get("A1").putValue("Categories");
cells.get("A2").putValue("Start");
cells.get("A3").putValue("Positive Value 1");
cells.get("A4").putValue("Negative Value 1");
cells.get("A5").putValue("Positive Value 2");
cells.get("A6").putValue("End");
waterfallChart.getNSeries().setCategoryData("A2:A6");
cells.get("B1").putValue("Values");
cells.get("B2").putValue(0);
cells.get("B3").putValue(20);
cells.get("B4").putValue(-10);
cells.get("B5").putValue(15);
cells.get("B6").putValue(25);
waterfallChart.getNSeries().add("B2:B6", true);
/*Shape sh = waterfallChart.getShapes().addTextBox(5, 0, 0, 5, 100, 100);
sh.setText("adding some TextBOX");*/
Shape sh1 = waterfallChart.getShapes().addTextBoxInChart(0, 10, 2000, 2000);
sh1.setText("filter:color Value");
Font filterLabelFont = sh1.characters(7, 18 ).getFont(); // duplicating words
Integer intColor1 = Integer.parseInt("00b0f0", 16);
Color clr1 = Color.fromArgb(intColor1);
filterLabelFont.setColor(clr1);
filterLabelFont.setSize(9);
filterLabelFont.setBold(true);
filterLabelFont.setName("Arial");
sh1.getLineFormat().setVisible(false);
workbook.save("C:\\D-drive\\logs\\WaterfallChart.xlsx");
System.out.println("Completed");
}
}