I previously considered the free web charting component from Carlos Aguilar to be my main web chart tool . . . but I recently strayed and found a new web chart component. NPlot has become my new main web charting squeeze because it gives me more control over the chart surface area, plotting behaviour, etc. Carlos Aguilar's component is quick and simple and will still be useful for basic web charting, but NPlot is the more sophisticated alternative.
It's hard to describe unless you've worked with both charting tools, but I've got considerably more control when I use NPlot. NPlot is still in development so you have to make due without much documentation and other polishes, but I really like what they've got so far. NPlot has a much more scientific aspect to it, with Abscissa and other slick math nerdy things. A project I'm working on requires some scientific data presentation and NPlot gives me the control I need and the customer wants.
Since the docs aren't available yet, here's a snippet that will get you up and running:
- Set a reference to the NPlot assembly (NPlot.dll) -- assuming you've downloaded the files from http://netcontrols.org/nplot/
- Add a PlotSurface2D control on your web form (drag and drop it or manually add it with the Register ASPX Page directive and add the control tag "<cc1:PlotSurface2D id="surface" runat="server" Width="200px" Height="100px"/>" to your web form
- Here is the quick-and-dirty sample code for your page Load event (in VB -gasp- since our customer requested we work in it):
surface.Title = "My Title"
Dim lp As LinePlot = New LinePlot
lp.DataSource = New Integer() {1, 5, 3, 4}
lp.Color = Color.RosyBrown
Dim dates As ArrayList = New ArrayList
dates.Add( CDate( "11/1/2004" ) )
dates.Add( CDate( "11/11/2004" ) )
dates.Add( CDate( "11/27/2004" ) )
dates.Add( CDate( "12/1/2004" ) )
lp.Color = Color.Blue
lp.AbscissaData = dates
surface.Add(lp)
surface.XAxis1.Label = "x-axis label"
surface.Refresh()
Oh yeah, if you want another reason to check out NPlot, it looks like the developers (Matt Howlett and Paolo Pierini) are into the Mono project after a fashion -- I don't know the full pedigree, I just know I can get great web reports out of it. Keep up the great work!
Posted
Wed, Mar 9 2005 12:56 PM
by
grant.killian