New Surface Pro 6

Using Chart Control in Visual Studio 2010 (Web and Windows Explained)

Downloading & Installing for Visual Studio 2008:.

 · I just want to ask real quick if someone could post a complete code of a working chart in truthandlifebible.info I can't find any complete examples so I'm going crazy since I can't get any of the examples from the, very comprehensive, downloadable chart examples to work. C# Chart Control Example This example shows how to display your data in your Windows Forms program as a bar graph or spline chart. To achieve this, you use Chart class in truthandlifebible.infong.

Surface Pro

 · Hi, I did not find the chart control in the toolbox section of Visual studio I truthandlifebible.info framework installed in my machine. I have also tried this option, Right clicking the toolbox, select Choose Items, and then select the following namespaces in truthandlifebible.info Framekwork Components tab · Hi Manikandan, Welcome to MSDN.

How to remove axis grids? Emmie Lewis-Briggman 3 Note it is for. DataVisualization , then add the appropriate using statement: RAJ 9 Try to include these lines on your code, after mych. Sanoob 1, 2 21 Next 0, 10 ; mych. Andrew Barefoot 11 1. Thanks for helping anyway.

Invalidate is the key. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password.

Post as a guest Name. Email Required, but never shown. You should notice that a single series called "Series1" is created by default with a new chart control. Figure 3 - Series Collection Editor.

If you run the project at this point you should receive data; however, it is not a very attractive chart. Lets take advantage of 3D with this chart. We can enable 3D for this chart by accessing the ChartAreas property on the chart control. Again a ChartArea1 is created by default.

Locate the property called Enable3D in the right pane, change the value from false to true and press Ok. The preview should change to reflect the change to 3D. Next, we can change the chart type on the series from Column to Spline. If you go ahead and run the project you should have a slightly more interesting chart as show in the figure below:.

Figure 4 - 3D Databound Chart. Next we should add a Title to the chart. This is done by creating a title using the Titles property on the chart control.

Similar to the series and chart area, a Title Colllection Editor is used to facility the process. Add a title by clicking on the Add button. Then locate the Title property in the right pane. Give your chart a title, change the styling if you so choose and click Ok. As you may have already guessed, you may add as many titles as needed for your chart.

To create a Legend for the chart we use the property Legend on the chart by clicking on the elipse. Using the Legend Collection Editor we can add one or more Legends. Simply clicking the add button will create and place a legend on the right side of the chart. You can adjust the styling and position of the legend using this screen. Under the Chart Area editor, select ChartArea1 and edit the Axis property to specify primary and secondary titles for the X and Y axis.

Unlike many 3rd party chart controls, the Microsoft Chart Control is actually very easy to populate in code behind. The following code snippet shows just how easy it is to add data points to the Series1 used above. However, you will need to remove data binding from the chart to prevent conflicts. Once we are done with the connection string click on the NEXT button will have the configuration to select the data from the table as shown in the screen below.

Since we need to pull the data from the table expand the table node and we can see the list of all the tables as shown in the screen below. Here we need to select the source table; since in our example ProductMaster table is the source we have selected that.

Once clicked on Finish button to complete the data source configuration section to proceed further. Now if we build and execute the application we will see the empty screen with an empty chart as shown in the screen below. The problem here is we have not set the X axis and Yaxis member to make the chart. Once we selected these values now click on the ok button to complete the configuration and now we are ready to build and execute the project. Press F5 to do so and you can see the end result in a much waited chart format in windows application as shown in the screen below.

Which is almost looks same like the web application result. So we are done with the windows application chart. Post your comments if any doubts and any feedback so that it will be useful for me to cover in my upcoming articles.

Login to post response. Introduction In this article we are going to see how to use the new charting control with visual studio Chart controls are introduced with Visual Studio as a patch in Service Pack 1. Chart controls provide a rich user interface for showing the numbers in a much graphical format where most of the end users are eager to look into. Microsoft Chart Control - Installation: Click on the license agreement to proceed further as shown in screen below.

We can find the Chart control in the toolbox as shown in the screen below. We need to navigate to the place where we downloaded the samples and open the solution as shown in the screen below It will open the solution will pre-loaded samples as shown in the screen below Now we will build the solution and execute the project to see the result.

The left side menu contains the different types of charts and for binding data and some common features required to be used for developing the application as shown in the below screen Each chart type is given with a tree view menu which has different types inside it like with normal chart view, 3D chart view and some other properties which developer need to take care as per their requirement. Chart Control in Web Application: We are going to create a new application in C and name it as WebDashboard as shown in the below screen Now once the project solution is opened you can drag and drop the chart control as shown in the screen below If we want to change the chart type as per our interest we need to select the tab which appears at the top right corner of the control as shown in the screen below In our example I have selected the Doughnut type as shown in the below screen Here we have an option to select the data source as well, say if we want to use an XML as a source for the chart we can directly provide the xml path which takes data and show the result in the chart view.

Just follow the below steps to configure the data source. Here the pop up shows the list of data source providers available, since in our example we are going to get the data from SQL Server we are going to select SQL from the list available as shown in the screen below Now click on ok to do the configuration of the server and the database from where we need to pull the data for the chart.

It will open a window for taking the connection as shown in the screen below Here I have connected to a Northwind database in my local server to fetch the data for the chart. Once the connection is selected click on NEXT will go to the next window where we need to select the table from which we need to pull the data as shown in the screen below Here we can select as per the requirement on the different table or a combination of tables with joins as per the requirement.

Here I have select a product table which has some basic product details as shown in the screen below Now once we selected the data required from the window click on NEXT button will move to the next screen where we can run the query and test the result set which we are going to show with the pictorial representation using the Chart control as shown in the screen below Now once everything is configured we need to click on the FINISH button to complete the configuration and we can see some configuration popups in the base version as shown in the screen below The X value member and the Y value member are the places where we need to provide the x axis and y axis like data upon which the chart will be created.

Here in our sample we are going to select Product name and Product Id as shown in the screen below Now we are half done with the configuration, to see some sample result we will execute the project.

To execute the solution press F5 we can see the screen with the chart on to it as shown in the screen below This is our expected output out of the chart control which we tried to create of. To do some enhancements just select the chart and go to properties and go to the Chart Areas as shown in the below screen Select the tool box will open the configuration window for the chart as shown below This is the window where we need to make the configuration enhancements for making the chart look better to the end users.

First enable 3D view as shown in the below screen Now we need to select the Inclination on how much the 3D view should be shown to the user, best option to show the chart in 3D view to the user will be something around 30 to Here we will select 50 and we can see the inclination in the background chart as shown in the screen below Next section is the Rotation; we need to set the rotation something between 30 to 70 to show the major of our output in the chart as per our requirement.

Here in our example we have set it to 50 and we can see the change in the chart as shown in the screen below Next property is the Back Color, we can change the background color of the chart as per the requirement using the property as shown in the screen below Once we are done with these configuration click on OK button to complete the first section of the configuration and we can see the changes straight forward on to the chart as shown in the screen below Now we will move on to some other properties to enhance the look of the chart.

Now again go to the properties of the chart control and go to the Legends section as shown in the below screen Clicking on the tool box will open the window as shown in the screen below. Now to build and execute the project press F5 and we can see the screen loaded and shown as below Now we are done with the charting control for a web application, which the above tutorial we can create a chart of our required pattern and create a good rich user attractive chart with the help of the Microsoft Chart Control.

Chart Control in Windows Application: We are going to create a new application in C and name it as WinDashboard as shown in the below screen Drag and drop the chart control to the form as shown in the screen below Now like in web application we will not be popped up with the tool box which has the list of chart types and the data source in build read for customizing.

Now to select the chart type we need to go to Series and the select the collections as shown in the screen below We will see a popup which has the list of chart types out of which we will select the Doughnut chart as shown in the screen below After we select the chart type click on OK button will change the chart image to Doughnut as shown in the below screen Now we need to select the data source, for that we need to navigate to Datasource in the properties menu and select to add a new datasource as shown in the screen below It will open the list of data source providers available as shown in the screen below.

From here we will select the SQL database Now select the database option from the list using this provider we are going to connect to the SQL server database. Once selected the database and clicking on NEXT will go to the next screen where we need to do the configuration as shown in the screen below Here based on the requirement we can select the model from which the data should be pulled.

Select Dataset and clicking on Next will move to the next screen as shown in the screen below Here we use the connection to the Northwind Database; else we can make use of the New connection to connect to any new servers locally or to the network to fetch the data.

Once we are done with the connection string click on the NEXT button will have the configuration to select the data from the table as shown in the screen below Since we need to pull the data from the table expand the table node and we can see the list of all the tables as shown in the screen below Here we need to select the source table; since in our example ProductMaster table is the source we have selected that.

Now if we build and execute the application we will see the empty screen with an empty chart as shown in the screen below The problem here is we have not set the X axis and Yaxis member to make the chart. So to provide the X axis and Y axis we need to go to the SERIES property and select the collections to mark the X axis and Y axis members as shown in the screen below Once we selected these values now click on the ok button to complete the configuration and now we are ready to build and execute the project.

Press F5 to do so and you can see the end result in a much waited chart format in windows application as shown in the screen below Which is almost looks same like the web application result. About the Author Full Name: Karthikeyan Anbarasan Member Level: India Thanks Karthik www.

Login to vote for this post. Hi Karthik, Extra ordinary presentation, 5 from me. Thanks for your lead: Hope it will be useful to every user who works on. Hi karthik, Good article As you said , it is very much useful. Good to hear from you: Ashok - Thanks for your comments!!!

Good presentation of content. Hi, It was an excellent topic I am very happy to learn the new topic thank u for posting such a good article But please tell me where to find the Microsoft Chart control samples! I navigated to the 3rd link couldn't locate

Introduction

Item 1 - CInt dtTest. I have no idea why the data I programmatically generate doesn't appear.

Closed On:

Next 0,10 ; mych.

Copyright © 2015 truthandlifebible.info

Powered By http://truthandlifebible.info/