Search code examples
razormodel-view-controllerchartsgoogle-visualizationmicrosoft-chart-controls

Google Charts VS Microsoft Chart Control


I am working on a project in which I have to display some dynamic graphs. I am new into web development and I am confused between Google Charts and Microsoft Chart Controls. I am using razor syntax and MVC.
Please suggest me for which charting library I should go for, as both are new for me and I need to learn both from start. Please guide.


Solution

  • I have used both, though I was using the Microsoft Chart Controls from Asp.net Web Forms. I'm fairly certain what you're asking about is still the same assembly (System.Web.DataVisualization namespace).

    The biggest difference between the two is that the Microsoft Chart Controls is primarily a server-side control. It renders a bitmap of the chart on the server, decorating it with HTML Image maps if you are making parts of the chart interactive. You may also want to take into account that the Microsoft Chart Controls -- to the best of my knowledge -- is no longer an actively developed product. You get what you've got and that's that. They are finished, so it's only a quality issue in that they aren't going to get any prettier or easier to use. If you are deploying to different locations often, setting up a temp folder for the chart controls with access permissions for your web server can be a pain. If you do not have such access it could also be a show stopper.

    On the other hand, the Google Charts API is entirely client-side. The API is required to be loaded asynchronously (the JavaScript is loaded after the page first loads, then the async loader API runs a callback function that you give it to draw the chart). The async loading can be a deal breaker if you need to work offline. The Google Charts API can be made highly interactive as it is drawn on client-side in JavaScript. The chart is rendered as SVG by default, allowing the charts to scale and resize very well.

    Having used both, I like the Google Charts API better. It's a little more flexible in the types of charts available. There was a little bit of a learning curve to get the data in the right format from the server, but I found a library for that. You can read about that part on my blog. All that being said, I had no regrets in using the Microsoft Chart Controls initially, because it used technologies I knew at the time.

    If you have a strong JavaScript background, go with Google. If you have a strong C# or Visual Basic background, it may be easier to hit the ground running with Microsoft Chart Controls. The same concept applies for Client vs. Server technologies. If you are happier with databinding on the server, you may like the Microsoft solution better, but if you are comfortable making client-side AJAX calls and using routes to return JSON, then Google Charts API can be a responsive solution for you.