c# - Print List string in new line in chart legends -
i have list of strings printing in chart legends. want print string in list 1 below other in chart legends
list<string> list = new list<string>(); if (table7.columns.contains(colx)) { (int yy = 0; yy < table7.rows.count; yy++) { double tval = double.parse(table7.rows[yy][colx].tostring()); if (tval < lower || tval > upper) { list.add(table7.rows[yy]["die_id"].tostring()); } } }
//strings in list printed in single line want print each of them 1 after other
legenditem firstitem = new legenditem(); font f = new font("serif", 14, fontstyle.bold); foreach (string s in list) { legendcell firstcell = new legendcell(legendcelltype.text, "" + s, contentalignment.bottomright); firstcell.font = f; firstitem.cells.add(firstcell); }
legenditem firstitem = new legenditem(); font f = new font("serif", 14, fontstyle.bold); legendcell firstcell = new legendcell(); (int l = 0; l < list.count;l++ ) { firstcell.text = list[l] + environment.newline +firstcell.text; firstcell.font = f; } firstitem.cells.add(firstcell);
Comments
Post a Comment