I have an ASP.NET/C# web app and I want to add the capability to generate very nice diagrams from the business data, in an E开发者_如何学Godward Tufte kind of way.
More specifically, it would be box diagrams where the size and shape of the boxes would be proportional to some value of the business object represented, the colouring would also have business meaning, and so on.
It would be completely custom (not a classical chart design) with complex notions such as networks (must display relationships between objects such as their position in a distribution network) and containers that size correctly depending on the size of what's inside them.
I guess that the diagram would be generated as an image file on the server side and then shown in the page.
What library/component can I use to answer that need?
You could do this on the client side using plain old canvas.
Check out Processing.js. You can draw arrows like this:
// Renders a vector object 'v' as an arrow and a location 'loc' void drawVector(Vector3D v, Vector3D loc, float scayl) { pushMatrix(); float arrowsize = 4; // Translate to location to render vector translate(loc.x,loc.y); stroke(255); // Call vector heading function to get direction (note that pointing up is a heading of 0) and rotate rotate(v.heading2D()); // Calculate length of vector & scale it to be bigger or smaller if necessary float len = v.magnitude()*scayl; // Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction) line(0,0,len,0); line(len,0,len-arrowsize,+arrowsize/2); line(len,0,len-arrowsize,-arrowsize/2); popMatrix(); }
Probably doesn't fit your exact requirements, but Google Charts is a quick and elegant way to generate charts just by constructing a URL.
http://www.telerik.com/products/silverlight/chart.aspx
http://www.telerik.com/products/aspnet-ajax/chart.aspx
maybe this helps.
精彩评论