Visual studio can be used as a development environment for projects using .netCHARTING. Below find step by step instructions for using the samples within an ASP.NET web application. Of course, you could use the sample directly just by running them through a web browser and edit the calling page directly in Visual studio instead which would require no additional setup outside of the regular install.
- Create new project, ASP.NET Web Application.
- Copy the Database folder from the .netCHARTING bundle into your project root ( for example in c:\inetpub\wwwroot\webApplication)
- Copy dotnetCHARTING.dll to the bin folder within your web application (like you did for the database in step 2)
- Add a reference to dotnetCHARTING.dll under the References node in Solution Explorer.
- Select Customize Toolbox from Tools menu and then add the dll to Toolbox or right-click on the tool box > Add/Remove Items > .net tab > browse to the dll > click OK. For more information, see this article.
- Copy and Paste the code from any of the .netCHARTING samples included in the bundle to your aspx page (you can delete any default html code which has been created through Visual Studio .NET wizard)
- Create a Temp folder in the project path same as step 2 or 3 and modify the permissions to have write access (See installation for more information).
- Make sure the path for database is set correctly.
- When you start the project you should see a chart based on the sample code you added.
|Copying the dotnetCHARTING.xml file to your bin folder will enable intellisense in visual studio.|
Common Problems and Resolutions:
When I start the WebApplication from Visual Studio I get Empty page.
Cause: The database folder does not exist in you project folder.
When I start the WebApplication from Visual Studio I get "CreateControl: generic error occurred in GDI+".
Cause: the Temp folder does not exist or does not have Write permissions.
Error in reading Database
Cause: ConnectionString property is not pointing to right path for the database.
When I drag and drop Chart control from Toolbox to Form , I get "error in CreateChildControl"
Solution: Add a reference to dotnetCHARTING.dll and under the References node in Solution Explorer.
I do not see the Chart Control in Toolbox.
Solution: Select Customize Toolbox from Tools menu and then add the dll to Toolbox or right-click on the tool box > Add/Remove Items > .net tab > browse to the dll > click OK.
Design Time Support:
The Chart control can used in design time in Visual Studio .NET (or web matrix).
You can use this control in an ASP.NET web Application (not in desktop or winforms applications)
As with any other control first you should add it to the Toolbox as follows:
- From Tools menu option select "Customize Toolbox" then browse and select the dotnetCharting.dll assembly and click OK.
- You will now see the chart control listed in the toolboxTool
- You may now drag and drop the chart into the aspx page and use it.
- You can use the Properties browser to see all chart control properties, and any changes when made on any properties, related code will be generated in code behind file in InitializeComponent() method, you can also write your own code, overriding any properties in the Page_load section or any part of file as you please.