chart图的caption(标题)怎样设置居中和字体大小

image

xml中文件

 <chart:pieChart id="pieChart"
                        datasource="keyvalueDs"
                        angle="30"
                        depth3D="30"
                        theme="LIGHT"
                        height="400px"
                        labelsEnabled="false"
                        labelText="[[title]]"
                        marginRight="20"
                        titleField="country"
                        valueField="litres"
                        width="100%"
                        align="MIDDLE_CENTER">
            <chart:legend enabled="true"
                          verticalGap="1"
                          fontSize="12"
                          align="CENTER"
                          autoMargins="true"
                          valueText=" "
                          equalWidths="true"
                          markerType="CIRCLE"
                          position="BOTTOM"/>
        </chart:pieChart>

代码

pieChart.setCaption(params.get("title").toString());

        List<Map<String,String>> list = (List<Map<String,String>>) params.get("pieMap");
        List<KeyValueEntity> listKeyValue = new ArrayList<>();
        list.forEach(map->{
            KeyValueEntity keyValueEntity = new KeyValueEntity();
            keyValueEntity.setValue("country",map.get("country"));
            keyValueEntity.setValue("litres",map.get("litres"));
            listKeyValue.add(keyValueEntity);
        });

        listKeyValue.forEach(keyValueEntity -> keyvalueDs.addItem(keyValueEntity));

看看文档这部分是否有帮助:
https://doc.cuba-platform.cn/charts-7.1-chs/chart_configuration.html#chart_titles