Skip to main content Skip to footer

How to Create a Vertical y-axis Title for FlexChart

In order to achieve a vertical y-axis title for FlexChart, you can handle the Rendering event for the FlexChart. Here is how you can handle the Rendering event.

private void FlexChart1_Rendering(object sender, RenderEventArgs e)
{
    e.Engine.SetStroke(Brushes.Black);
    e.Engine.SetFont(new Font("Segoe UI", 9));
    flexChart1.AxisY.TitleStyle.Stroke = Brushes.Transparent;
    string title = flexChart1.AxisY.Title;
    title = String.Join("\n", title.ToCharArray());
    var x = flexChart1.PlotRect.X -40;
    var y = (flexChart1.PlotRect.Height / 2) + (title.Length*5);            
    e.Engine.DrawStringRotated(title, new C1.Chart._Point(x, y), new C1.Chart._Point(x, y), 0);
}