I need to change the font size of data labels in a chart at runtime with FlexCel .NET. The number of data labels is dynamic, and I need to reduce the font size when there are many labels (e.g., more than 20) to prevent them from overlapping.
My process is:
- Load a template with a chart.
- Populate the data.
- I need to modify the data label font size of the rendered chart.
I have tried some code that APIMate creates for my result file (with modified Data Labels), but runtume it does not affect my result file
here is example of my manually modified chart and APIMate code
APIMate_code.txt (206.2 KB)
In the code some lines are very specific because of my font size,
for example
LabelTextOptions = new TChartTextOptions(new TFlxChartFont("Calibri", 700, TExcelColor.FromArgb(0x00, 0x00, 0x00), TFlxFontStyles.Bold, TFlxUnderline.None, TFontScheme.None), THFlxAlignment.center, TVFlxAlignment.center, TBackgroundMode.Transparent, TextFillOptions);
...
LabelTextOptions = new TChartTextOptions(new TFlxChartFont("Calibri", 1000, TExcelColor.FromArgb(0x00, 0x00, 0x00), TFlxFontStyles.Bold, TFlxUnderline.None, TFontScheme.None), THFlxAlignment.center, TVFlxAlignment.center, TBackgroundMode.Transparent, TextFillOptions);
..
LabelTextOptions = new TChartTextOptions(new TFlxChartFont("Calibri", 900, TExcelColor.FromArgb(0x00, 0x00, 0x00), TFlxFontStyles.Bold, TFlxUnderline.None, TFontScheme.None), THFlxAlignment.center, TVFlxAlignment.center, TBackgroundMode.Transparent, TextFillOptions);
but my test run with similar changes inmy code does not change final excel result.
If someone has expirience with changes like that- please let me know how tro proceed it properly....