ChartEx.Title Property
Gets or sets the chart title.
Namespace: DevExpress.Docs.Presentation
Assembly: DevExpress.Docs.Presentation.v26.1.dll
Declaration
Property Value
| Type | Description |
|---|---|
| ChartTitleEx | The chart title. |
Remarks
The following code snippet creates a Waterfall chart with a title:
using DevExpress.Docs.Office;
using DevExpress.Docs.Presentation;
using System.Drawing;
namespace PresentationApiSample;
public class Program {
public static async Task Main(string[] _) {
// Create a presentation.
Presentation presentation = new Presentation();
// Reset the slide collection.
presentation.Slides.Clear();
// Add a blank slide.
Slide slide = new Slide(SlideLayoutType.Blank);
presentation.Slides.Add(slide);
// Insert a chart on the slide.
ChartEx chart = new ChartEx();
slide.Shapes.Add(chart);
// Set chart size to match the slide.
chart.Width = presentation.SlideSize.Width;
chart.Height = presentation.SlideSize.Height;
// Create a waterfall series and specify data.
WaterfallSeries series = new WaterfallSeries();
series.Text = "Cash Flow";
series.Arguments = new ChartStringData(new[] { "Start", "Jan", "Feb", "Mar", "End" });
series.Values = new ChartNumericData(new[] { 0.0, 12.0, -5.0, 8.0, 15.0 });
// Add the series to the chart.
chart.Series.Add(series);
// Set chart title formatting.
chart.Title = new ChartTitleEx(new TextArea {
Text = "Waterfall chart",
Level1ParagraphProperties = new TextParagraphProperties {
TextProperties = new TextProperties { FontSize = 30, Fill = new SolidFill(Color.DarkBlue) }
}
});
}
}
See Also