private static RectangleF GetSeriesLabelRelativeRect(ChartGraphics graph, ChartArea area, Series series, RectangleF seriesRelativeRect, DataPoint point) { if (!string.IsNullOrEmpty(series.legendText) && TreeMapChart.IsLabelVisible(point)) { using (Font font = TreeMapChart.GetSeriesLabelFont(point)) { return(TreeMapChart.GetLabelRelativeRect(graph, font, seriesRelativeRect, series.legendText, LabelAlignmentTypes.TopLeft)); } } return(RectangleF.Empty); }
private static void RenderSeriesLabel(ChartGraphics graph, TreeMapNode seriesTreeMapNode, RectangleF labelRelativeRect) { if (!labelRelativeRect.IsEmpty) { Series series = seriesTreeMapNode.Series; DataPoint dataPoint = seriesTreeMapNode.DataPoint; using (Font font = TreeMapChart.GetSeriesLabelFont(dataPoint)) { StringFormat stringFormat = new StringFormat(); stringFormat.Alignment = StringAlignment.Near; stringFormat.LineAlignment = StringAlignment.Near; graph.DrawStringRel(series.legendText, font, new SolidBrush(dataPoint.FontColor), labelRelativeRect.Location, stringFormat, 0); } } }