CPF/CPF.ReoGrid/Chart/ChartTitle.cs

25 lines
586 B
C#
Raw Normal View History

2024-06-24 10:15:59 +08:00
using System;
using CPF.ReoGrid.Drawing;
using CPF.ReoGrid.Graphics;
using CPF.ReoGrid.Rendering;
namespace CPF.ReoGrid.Chart
{
internal class ChartTitle : DrawingObject
{
public IChart Chart { get; set; }
public ChartTitle(IChart chart)
{
this.Chart = chart;
this.FontSize += 5f;
}
protected override void OnPaint(RDrawingContext dc)
{
IGraphics graphics = dc.Graphics;
graphics.DrawText(this.Chart.Title, this.FontName, this.FontSize, StaticResources.SystemColor_WindowText, this.ClientBounds, ReoGridHorAlign.Center, ReoGridVerAlign.Middle);
}
}
}