Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

How can I make my Chart Web Part look good when I use it with lookup fields?

The issue I have is that the chart displays the field id along with its value. For example, it displays "2;#Bing" when I'd like to see only "Bing".

share|improve this question

2 Answers 2

you can use xpath to do that, for example /dsQueryResponse/Rows/Row[substring-after(@field., '#')

But that has to be done in a dataview that displays a content source in your page

Another way would be to use javascript or jquery to split the text of a paragraph or a div for example with a specific id Hope that helps

Tolis

share|improve this answer

I have mention how to split values in your chart web part,

foreach (DataRow item in dt.Rows)
{
   if (!string.IsNullOrEmpty(item["YourItemname"].ToString()) && item["yourItemname"].ToString().Contains("#"))

   item["YourItemname"] = item["YourItemname"].ToString().Split('#')[1];
}

Hope this answers is very helpful for you.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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