SharePoint - Customize chart webpart title - Asked By hari sharepoint on 24-May-12 02:07 PM


I have a pie chart webpart which is attached to sharepoint custom list. Custom list has data queried from MYSQL database.

I want to customize the chart web part title to display one item name from the list behind the chart. Is it possible to write javascript code or to use sharepoint designer? Can any one help me with this. Thank you.

LIJO PHILIP replied to hari sharepoint on 24-May-12 10:26 PM

you can do this with Javascript using the jQuery libraries.  

Jitendra Faye replied to hari sharepoint on 25-May-12 01:21 AM
Refer these links-

Here i have found same post

[)ia6l0 iii replied to hari sharepoint on 28-May-12 08:45 AM
I assume that you use the inbuilt chart webpart and not highcharts as the other member points out. 

If that is the case, modifying the chart title using jQuery is the easiest option. Find the rendered code, and you shall find the chart title rendered mostly as a span/h2/h3 element. It should look something like below:
<h3 class="ms-WPTitle">

$('.ms-WPTitle').val('new title here');

Note that you need to add more attributes to the condition I used above to figure out the element. A page can have multiple elements with the wptitle css attribute. 

Hope this helped.