NPlot Bar Charts

There is a free charting component for ASP.NET by the name of NPlot but it is poorly documented and I could not figure out how to create a simple bar chart. I contacted one of the developers and he sent me some code that pointed me in the right direction.

I have created some sample code in VB.NET and C# which I shall offer to the developers because their Wiki asks for someone to submit some examples of bar charts. I used the Northwind SQL Server sample database as the data source for my bar charts. The Northwind database is frequently used to demonstrate database concepts and anyone may download a copy. The only innovative aspect to my sample code is the rather complicated SQL query I use to get the data. First I get the distinct values for one of the columns and then I get a record count of another column based on the distinct value. This is a fairly difficult query to create but it is useful for getting data for charts of record counts by date.

I also created a NPlot bar chart that used a XML file as the data source. This was pretty difficult because I loaded the XML into a dataset and the columns wound up having a string data type when they needed to have the double data type. I had to create new columns with the correct data type and then use dataset expressions to calculate their values based on the existing columns. Dataset expressions were another NET Framework feature that I’d never heard of.

This entry was posted in ASP.NET, General. Bookmark the permalink.

3 Responses to NPlot Bar Charts

  1. waleed says:

    I need the source code for teh to use the nplot control



  2. waleed says:

    i need the source code to use teh nplot tool .



  3. Chris Lokey says:


    I am having a rough time trying to create some bar charts in nPlot. I don’t suppose you would be willing to share with me the source code/examples you created, so I can get a feel for what I am doing wrong here? Thank you in advance for your time.


Leave a Reply

Your email address will not be published. Required fields are marked *