Hye,
I have some problems with text in charts.
First, when I try to change the font color of DataLabels the final color in Excel isn’t the color I choose. By instence the color is yellow when I choose red. However the color is set in the palette.
I have done that when I init my style : Workbook.ChangePalette(Color.FromArgb(0, 149, 55, 53), 5)
And when I do that : MyChart.NSeries(0).DataLabels.Font.Color = Color.FromArgb(0, 149, 55, 53), the color in my excel document is yellow and not red.
Second, I would like to know if is it possible to select a part of a text in the title of a chart. Does the method setCharaters exist for chart title ? And if this method doesn’t exist, how can I change the font property of a part of a chart title ?
Finally, I would like to put in the right bottom of my chart some text (or an image, but I would prefer text !), is it possible to do that ? Or is it possible to cheat with the CategoryAxis.Title, I try but it wasn’t a success.
Thanks
Hi,
Thanks for considering Aspose.
First).
Well, there seams to have some sort of problem setting custom colors to the data labels. We will sort out the things soon. And mind you, the property of DataLabels class is "TextFont" and not "Font".
Second).
Yes you may select a part of the chart title e.g., Dim chrs As String = chart.Title.Text.Substring(0,5) But you cannot change its font attributes directly. we will look into it if we can enhance it according to your need.
Thank you.
Hi,
1,Please try this fix.
2,3 We will look into the two problems.
Your second requested feature is not supported now.
For 3rd feature, you can try following code with this attached fix:
TextBox textBox = chart.Shapes.AddTextBoxInChart(200,200,2000,2000);
textBox.Text = "mytest";
Thanks I’ll try all this on monday. Thanks for your rapidity
Please try this attached version. In previous attached fix, I forgot to expose Chart.Shapes property.
Thanks, the problem is solved for 1 and 3.
I have juste an another question about the method chart.Shapes.AddTextBoxInChart and chart.Shapes.AddLabel : what are the unit of the parametres ? Is it pixel or percent or something different ?
Hi,
Yes, it is pixel.
Thank you.
I have noticed another problem. I understand that for the moment it’s not possible to change the font of a part of the chart title. But in the document I am generating when I try to change manualy (in Excel) the font property of my chart title, Excel crash.
I try to make a project exemple, but the problem not appear.
The problem appear with Excel 2000 and Excel 2003. My document has 13 pages (I can’t send you the document)
Hi,
The unit of the chart.Shapes.AddTextBoxInChart is 1/4000 of the chart area
Now we do not support to add Label to the chart. Do you need to add Label to the chart?
Setting the font of the part of the chart title will be available soon.
Ok, thanks
Yes I need to add a Label to a chart (in the right bottom of the chart, and I have many chart with different width and height), but for me it’s easier to use row number and column number so I do like this :
Dim label As Label = Worksheet.Shapes.AddLabel(1, 1, 2, 2, 2, 2)
label.Text = "myText"
label.TextFame.AutoSize = False
label.UpperLeftColumn = LeftColumnOfMyGraph - 1
label.UpperLeftRow = LeftRowOfMyGraph - 2
label.LowerRightColumn = RightColumnOfMyGraph - 1
label.LowerRightRow = RightRowOfMyGraph - 1
label.UpperDeltaX = 900
label.LowerDeltaX = 900
label.UpperDeltaY = 150
label.LowerDeltaY = 150
label.FillFormat.IsVisible = False
Moreover I need to add an image to my chart but the quality is too bad. So I use a label
I hope the possibility to select a part of a chart title will be avaible soon.
Thanks
Please try this attached fix. It solves the chart title font issue.
Everything is OK. Thanks for your reactivity.
Hi,
We have supported to add Label to chart. Please use Shapes.AddLabelInChart mehod.
Please try the fix in
Thanks. I tried it, but for me it’s easier to place the label (or the picture) with the row number, and column number. So I prefer to use the method .Shapes.AddLabel and .Shapes.AddPicture
Are you considerating to add the possibility to change font property of a label ?
Hi,
In my opition, it's easy to use Shapes.AddLabelInChart to add label to chart. We will support to add label to the chart with Shapes.AddLabel .
I could not change the font of the label with MS Excel?Which Excel vsersion are you using?
I’m not sure to understand your question, but I can’t change the font property of a label in Excel 2000, 2003, and 2007.
My problem with the method Shapes.AddLabelInChart is that I have a document with 13 pages, each page contains some charts, located at different position, and each chart have different width and size. I have a generic method to add a chart with cells corner’s as parameters. If I want to add a label at the rigth bottom of each chart, it’s not so easy to make something generic. So I prefer to do with row and column number : I have the cell for the right bottom of my chart in the parameter of my method.
Hi,
Ms Excel do not support to change the font of label. So we do not support to do it.
If you want to add the lable at the right bottom of the chart, use the code : Shapes.AddLableInChart(left,top, 4000 - left,4000 - top);
Thanks, I’ll try this