use of org.openxmlformats.schemas.drawingml.x2006.chart.CTStrRef in project poi by apache.
the class XSSFChart method setTitleFormula.
/**
* Set the formula expression to use for the chart title
* @param formula
*/
public void setTitleFormula(String formula) {
CTTitle ctTitle;
if (chart.isSetTitle()) {
ctTitle = chart.getTitle();
} else {
ctTitle = chart.addNewTitle();
}
CTTx tx;
if (ctTitle.isSetTx()) {
tx = ctTitle.getTx();
} else {
tx = ctTitle.addNewTx();
}
if (tx.isSetRich()) {
tx.unsetRich();
}
CTStrRef strRef;
if (tx.isSetStrRef()) {
strRef = tx.getStrRef();
} else {
strRef = tx.addNewStrRef();
}
strRef.setF(formula);
}
use of org.openxmlformats.schemas.drawingml.x2006.chart.CTStrRef in project ocvn by devgateway.
the class XSSFChartUtil method buildStrRef.
private static void buildStrRef(final CTStrRef ctStrRef, final ChartDataSource<?> dataSource) {
ctStrRef.setF(dataSource.getFormulaString());
CTStrData cache = ctStrRef.addNewStrCache();
fillStringCache(cache, dataSource);
}