Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Form C# Graph Axes Label on both X & Y axes

Can anyone please tell me how to write the labels on the x-y-axes on the graph? The ones that say "Time(s)" & "Speed (m/s)".

I am using System.Windows.Forms.DataVisualization.Charting.Chart. There should be a simple property somewhere which I am missing or is it something more complicated?

graph with labeled axes

like image 583
dushyantp Avatar asked Apr 26 '12 10:04

dushyantp


People also ask

What is a Windows form in C#?

Windows Forms is a Graphical User Interface(GUI) class library which is bundled in . Net Framework. Its main purpose is to provide an easier interface to develop the applications for desktop, tablet, PCs. It is also termed as the WinForms.

Is WinForms still used in 2022?

Now, in 2022, with increasing competition and the adoption of newer more modern technologies the popularity and usage of WinForms are at an all-time low.

Is WinForms going away?

Win Form has been used to develop many applications. Because of its high age (born in 2003), WinForm was officially declared dead by Microsoft in 2014.


1 Answers

I am using the charts control on the web and setting the X and Y axis titles are done in the following way.

I assume the API would be the same for winforms.

var chartArea = new ChartArea("MyChart");
...
chartArea.AxisX.Title = "Times(s)";
chartArea.AxisY.Title = "Speed (m/s)";
like image 90
Philip Fourie Avatar answered Nov 15 '22 18:11

Philip Fourie