1

I would like to display a pie chart in a custom SharePoint application page. One option to do this is by using MSCharts and <asp:Chart> tag. However, getting this to work requires modification of web.config. Because I would like my app to be easily deployable to different environments (across farms and web applications), I'd prefer not having to edit web.config to get charts to work, as this requires tedious extra work to avoid potential production problems (as far as I know - is there an easy automatic way to solve this?).

Are there any other (ideally out of the box) charting options that I can use in a robust, easy-to-deploy way, i.e. I'd like to minimize the chance of production environment problems due to e.g. invalid web.config?

Ideally, I'd like to avoid scripts and would have total C# control over the displayed data.

2

2 Answers 2

1

A possible scenario, if you need to modify the data source programmatically, would be to create a custom Web Part that inherits from the Chart Web Part. Then you can set the values using the properties from the base class by overriding the binding methods.

I would highly recommend first adding a Chart Web Part using the SP User Interface, configuring it and then exporting it so that you can peek into the correct syntax for the properties you want to set.

One of the key methods would be CreateDataBinding: http://msdn.microsoft.com/en-us/library/microsoft.office.server.webcontrols.chartwebpart.createdatabinding(v=office.14).aspx

And one of the key properties to look at would be ChartXml.

http://msdn.microsoft.com/en-us/library/microsoft.office.server.webcontrols.chartwebpart_properties(v=office.14).aspx

0

Have you tried the out of the box chart web part?

http://office.microsoft.com/en-us/sharepoint-server-help/introduction-to-the-chart-web-part-HA101889216.aspx

1
  • I've encountered this one, but haven't found anything on how to work with it dynamically - e.g. insert it in aspx, bind custom data etc.
    – w128
    Mar 28, 2014 at 15:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.