Windows forms chart control tutorial




















Step 3 Go to Chart properties then click on Series. Change the name of Series. Here, I set the name to Salary. Go to the Form1. Series[ "Salary" ]. AddXY "Ajay" , "" ; chart1. AddXY "Ramesh" , "" ; chart1. AddXY "Ankit" , "" ; chart1. A Windows forms application is one that runs on the desktop computer. A Windows forms application will normally have a collection of controls such as labels, textboxes, list boxes, etc.

Below is an example of a simple Windows form application C. It shows a simple Login screen, which is accessible by the user. The user will enter the required credentials and then will click the Login button to proceed. So an example of the controls available in the above application. For this, we would need to implement the below-mentioned steps. Step 1 The first step involves the creation of a new project in Visual Studio.

Step 2 The next step is to choose the project type as a Windows Forms application. Here we also need to mention the name and location of our project. You will see a Form Designer displayed in Visual Studio. This solution will contain the below 2 project files. On the left-hand side of Visual Studio, you will also see a ToolBox. The toolbox contains all the controls which can be added to a Windows Forms. Controls like a text box or a label are just some of the controls which can be added to a Windows Forms.

To go to the properties of a control, you need to right-click the control and choose the Properties menu option. If you follow all of the above steps and run your program in Visual Studio, you will get the following output.

In the output, you can see that the Windows Form is displayed. In our Windows form application in C examples, we will create one form which will have the following functionality. A group box is used for logical grouping controls into a section. Ideally, these are details of a person, so you would want to have these details in a separate section on the Form. For this purpose, you can have a group box. Step 1 The first step is to drag the Groupbox control onto the Windows Form from the toolbox as shown below.

Step 2 Once the groupbox has been added, go to the properties window by clicking on the groupbox control. In the output, you can clearly see that the Groupbox was added to the form. Next comes the Label Control. AddXY "Ramesh" , "" ;. AddXY "Ankit" , "" ;. AddXY "Gurmeet" , "" ;.

AddXY "Suresh" , "" ;. Add "Salary Chart" ;. Open ;. Fill ds ;. Close ;. Email This BlogThis! Share to Twitter Share to Facebook. Newer Post Older Post Home. Gets or sets the background image alignment used for the Unscaled drawing mode. Gets or sets the color of the Chart control that will be displayed as transparent. Gets or sets the drawing mode for the background image of the Chart control.

Gets or sets the BindingContext for the control. Gets or sets a BorderSkin object, which provides border skin functionality for the Chart control. Gets the distance, in pixels, between the bottom edge of the control and the top edge of its container's client area. Gets or sets the size and location of the control including its nonclient elements, in pixels, relative to the parent control.

Gets the build number of the Chart control. Gets a value indicating whether the ImeMode property can be set to an active value, to enable IME support. Gets or sets a value indicating whether the control causes validation to be performed on any controls that require validation when it receives focus. Gets the IContainer that contains the Component.

Gets a value indicating whether the control, or one of its child controls, currently has the input focus. Gets or sets the ContextMenuStrip associated with this control. Gets a DataManipulator object that provides methods and properties that handle data. Gets or sets the data source for the Chart object. Gets the length and height, in pixels, that is specified as the default maximum size of a control.

Gets the length and height, in pixels, that is specified as the default minimum size of a control. Gets a value that indicates whether the Component is currently in design mode.

Gets a value indicating whether the base Control class is in the process of disposing. Gets or sets which control borders are docked to its parent control and determines how a control is resized with its parent.

Gets or sets a value indicating whether this control should redraw its surface using a secondary buffer to reduce or prevent flicker. Gets the list of event handlers that are attached to this Component. Gets or sets the text color of the Chart control.

Gets a value indicating whether the caller must call an invoke method when making method calls to the control because the caller is on a different thread than the one the control was created on. Indicates if one of the Ancestors of this control is sited and that site in DesignMode. This property is read-only. Gets or sets the distance, in pixels, between the left edge of the control and the left edge of its container's client area. Gets or sets a LegendCollection that stores all Legend objects used by the Chart control.

Gets or sets the coordinates of the upper-left corner of the control relative to the upper-left corner of its container. Gets or sets the size that is the upper limit that GetPreferredSize Size can specify. Gets or sets the size that is the lower limit that GetPreferredSize Size can specify.

Gets or sets the palette for the Chart control. Gets a read-only PrintingManager object used for printing a chart. Gets or sets the horizontal resolution of the Chart renderer.

Gets or sets the vertical resolution of the Chart renderer. Gets the distance, in pixels, between the right edge of the control and the left edge of its container's client area.

Gets or sets a value indicating whether control's elements are aligned to support locales using right-to-left fonts. Gets a ChartSerializer object that is used for chart serialization.

Gets a SeriesCollection object, which contains Series objects. Gets a value indicating whether the user interface is in the appropriate state to show or hide keyboard accelerators. Gets or sets the size of the Chart control. Gets or sets a value indicating whether the user can give the focus to this control using the TAB key. Gets or sets the TextAntiAliasingQuality type to use when applying anti-aliasing to text.

Gets or sets a TitleCollection object that is used to store all Title objects used by the Chart control.

Gets or sets the distance, in pixels, between the top edge of the control and the top edge of its container's client area. Gets the parent control that is not parented by another Windows Forms control. Typically, this is the outermost Form that the control is contained in. Gets or sets a value indicating whether to use the wait cursor for the current control and all child controls.

Notifies the accessibility client applications of the specified AccessibleEvents for the specified child control.

Aligns data points along the X axis using their axis labels. Applicable when multiple series are indexed and their X-values are strings. Aligns data points using their axis labels. All series in the chart are aligned, using the specified sort order. Aligns data points from different series along the X axis using their axis labels. The specified series in the chart are aligned using an ascending sort order.

Sets the automatically assigned series and data point colors, to allow programmatic access at run time. Executes the specified delegate asynchronously on the thread that the control's underlying handle was created on. Executes the specified delegate asynchronously with the specified arguments, on the thread that the control's underlying handle was created on. When overridden in a derived class, returns the custom AccessibleObject for the entire chart.

Forces the creation of the visible control, including the creation of the handle and any visible child controls. Creates the Graphics for the control.

Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. Data binds the Chart control to a data source.

Automatically creates and binds series data to the specified data table, and optionally populates X-values. Releases all resources used by the Component. Signals to the Chart object that initialization is complete. Retrieves the return value of the asynchronous operation represented by the IAsyncResult passed. Retrieves the specified AccessibleObject. Retrieves a value indicating how a control will behave when its AutoSize property is enabled. Retrieves the child control that is located at the specified coordinates, specifying whether to ignore child controls of a certain type.

Returns the next ContainerControl up the control's chain of parent controls. Retrieves the current lifetime service object that controls the lifetime policy for this instance. Gets the Type of the current instance. Determines the chart element, if any, that is located at a point defined by the given X and Y coordinates. Determines the chart element, if any, that is located at a point defined by given X and Y coordinates.

Transparent elements can optionally be ignored. Determines whether a chart element that is one of the specified types is located at a point defined by the given X and Y coordinates.

Determines if a chart element of a given type is located at a point defined by given X and Y coordinates. Invalidates the entire surface of the Chart and causes the Chart control to be redrawn. Invalidates a specific region of the control and causes a paint message to be sent to the control. Optionally, invalidates the child controls assigned to the control.

Invalidates the specified area of the Chart control. Invalidates the specified region of the control adds it to the control's update region, which is the area that will be repainted at the next paint operation , and causes a paint message to be sent to the control. Executes the specified delegate, on the thread that owns the control's underlying window handle, with the specified list of arguments.

Raises the GotFocus event for the specified control. Raises the LostFocus event for the specified control. Raises the Click event for the specified control. Raises the Paint event for the specified control. Raises the PaintBackground event for the specified control. Determines whether the specified key is a regular input key or a special key that requires preprocessing.

Loads a template into the Chart control from an image stream. Transforms a size from logical to device units by scaling it for the current DPI and rounding down to the nearest integer value for width and height. Creates a shallow copy of the current Object.

Creates a shallow copy of the current MarshalByRefObject object. Raises the Invalidated event with a specified region of the control to invalidate. Raises the AutoSizeChanged event. Raises the BackColorChanged event. Raises the BackgroundImageChanged event.

Raises the BackgroundImageLayoutChanged event. Raises the BindingContextChanged event. Raises the CausesValidationChanged event. Raises the ChangeUICues event. Raises the Click event. Raises the ClientSizeChanged event. Raises the ContextMenuChanged event.

Raises the ContextMenuStripChanged event. Raises the ControlAdded event. Raises the ControlRemoved event. Raises the CreateControl method. Raises the Customize event. Raises the CustomizeLegend event. Raises the DockChanged event.

Raises the DpiChangedAfterParent event. Raises the DpiChangedBeforeParent event. Raises the DragDrop event. Raises the DragEnter event. Raises the DragLeave event. Raises the DragOver event. Raises the EnabledChanged event. Raises the Enter event.

Raises the FontChanged event. Raises the ForeColorChanged event. Raises the FormatNumber event. Raises the GiveFeedback event. Raises the GotFocus event. Raises the HandleCreated event. Raises the HandleDestroyed event. Raises the HelpRequested event. Raises the ImeModeChanged event. Raises the Invalidated event. Raises the KeyDown event. Raises the KeyPress event.



0コメント

  • 1000 / 1000