2

I imagine this question will not bear anything, but this is a last ditch attempt before I have to tell my PM I simply can't do it.

My colleague (usefully before leaving the project) was a yes man to everything our PM asked for, regardless of what it was, and I seem to have been volunteered to create some functionality that will generate an Organogram / Organisational Chart and present it in the view.

I have dug around and asked around, no one really seems to know how I would go about doing this. Can anyone offer any advice on anything that can help? Even if it's the most basic tutorial or obscure API ever, it will be helpful.

To put a point on it, my question is: Is it possible to generate a chart in an ASP.NET MVC C# Application, and display it on a View? (Even a yes or no would help)

tereško
  • 58,060
  • 25
  • 98
  • 150
Felix Weir
  • 459
  • 7
  • 18

3 Answers3

0

Yes, everything is possible. It's just a matter of how much time you can spend on it. Not everything has a good return on investment though, but that's for your PM to decide. As long as your team can make an estimation of the complexity.

But for ASP.NET, Microsoft has a Charting library that allows you to build charts. There are also commercial libraries (the first google hit) out there that are more feature rich.

And if they don't work, you can Always build images manually using the System.Drawing namespace of .NET (that will of course take considerably more time than plotting a chart using one of the available libraries). Generated images can be sent through an ashx handler, or you can embed the image in the same page using base64 encoding.

It's not bad to say yes to your PM, but I rather say: "Yes, we will stick this feature on the feature list / back log, and make a estimate of the complexity. Once we know the complexity you can choose to select it for a future iteration." But perhaps I'm talking too Agile now ;-)

Community
  • 1
  • 1
Steven
  • 166,672
  • 24
  • 332
  • 435
0

You can hand off the chart drawing to an external library, for example, Google Visualization: Organizational Chart

Have a look at this question for other suggested librairies: What's the best library to draw organization chart using JavaScript?

Community
  • 1
  • 1
Reda
  • 2,289
  • 17
  • 19
0

This sounds like it's in a commercial scenario, so it's really worth looking at the commercially available solutions. Steven already mentioned one, but as far as I can see that one is for Windows Forms and the other one is for charts as in bar charts and provides no organigram features.

A Javascript diagramming library with the capabilities of displaying organizational charts is yFiles for HTML. It has a nice online example of an organization chart that might be exactly what you are looking for:

Organization Chart Demo

There is also a Video that shows the demo in action.

The library is a pure Javascript implementation that does not depend on server libraries or servers at all. Integrating it in an ASP.net environment should be easy though, as long as you know Javascript. Being a library it offers full customization capabilities. You can determine the look and the feel of all aspects of the chart. Under the hood the library is a generic graph drawing and editing tool and the organizational chart is just one possible use-case.

Full disclosure: I work for the company that created the library, but on SO I do not represent my employer. My comments, thoughts, etc. are my own.

Sebastian
  • 7,729
  • 2
  • 37
  • 69