Hello.
I’m trying to insert the alt text on a Shape.
The shape itself is being inserted and I am able to change colors and all, but the only issue is that I can’t make the title to show up.
Here’s the portion of the code:
I’ve inserted a Console.WriteLine just to make sure that the variable is returning what’s expected.
private void DrawGeneralGradeChart(string fieldName, DocumentBuilder mBuilder, List<Tuple<double, double, double, string>> Data, ImageFieldMergingArgs args)
{
if (args.FieldValue != null)
{
mBuilder.MoveToField(args.Field, true);
var total_itens = 100;
var colors = new Dictionary<string, List<int>>();
colors.Add("GeneralGrade", new List<int>{73, 190, 136});
colors.Add("ClassGrade", new List<int>{35, 125, 200});
var gradesRectangle = new Dictionary<string, double>();
gradesRectangle.Add("ClassGrade", (total_itens / 100) * Data.Sum(t => (int)t.Item1));
gradesRectangle.Add("GeneralGrade", (total_itens / 100) * Data.Sum(t => (int)t.Item2));
var grade_total = gradesRectangle[fieldName];
Shape gradeRectangle = mBuilder.InsertShape(ShapeType.Rectangle, gradesRectangle[fieldName], 10);
Shape totalItensRectangle = mBuilder.InsertShape(ShapeType.Rectangle, total_itens - gradesRectangle[fieldName], 10);
totalItensRectangle.FillColor = Color.Gray;
totalItensRectangle.Stroked = false;
gradeRectangle.Title = $"{gradesRectangle[fieldName]}%";
Console.WriteLine($"{gradesRectangle[fieldName]}%");
gradeRectangle.FillColor = Color.FromArgb(colors[fieldName][0], colors[fieldName][1], colors[fieldName][2]);
gradeRectangle.Stroked = false;
args.Field.Remove();
}
}