Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Scripting onmouseover Interactivity Tooltips
cld49
Hey guys!
I'm stuck, and I'd really appreciate it if anyone has any insight!
I have a pie chart which has one series of Report Counts and is categorized by date (so, it's a pie chart where the pie slices are by the number of reports on a certain date or month, etc). When I choose a label in Format Chart -> Value Series -> Labels, I have the option of adding the "Percentile Value Data", which is the percentage for each pie slice. For this label, I actually have the percentile value data, value data, and category data (date) with some scripting in the chart to change which ones show depending on other parameters.
The flyover for each slice needs to show the Percentile Value Data (again depending on some other parameters). However, when I go into Format Chart -> Value Series -> Interactivity -> Icon to Format Tooltip Text -> Variables -> Chart Data Point the only options are Category Data, Value Data, and Value Series Name. This is odd, since I expected to have the same options here as I did for the label. So, is there a way in the chart scripting to set this tooltip text myself (like I am doing the labels in beforeDrawDataPointLabel()), or, is there some secret super-duper way to find the Percentile Value Data in that interactivity function menu?
Any help is greatly appreciated!! Thanks guys!!!!
Find more posts tagged with
Comments
kclark
Hi cld! You can set the tooltip for the chart in the onCreate() using helpText doing something like this<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
this.helpText = "Customer Number: "+this.getRowData().getColumnValue("CUSTOMERNUMBER");
</pre>
<br />
Take a look <a class='bbc_url' href='
http://www.birt-exchange.org/org/devshare/designing-birt-reports/443-birt-table-tooltip-examples/'>at
this devshare</a> It has a good example rptdesign. You can extend this even further and use an HTML table as a tooltip, if that's something you might want to use <a class='bbc_url' href='
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1446-html-table-as-a-tooltip-in-a-chart/'>take
a look at this.</a>
cld49
<blockquote class='ipsBlockquote' data-author="'kclark'" data-cid="112385" data-time="1355351045" data-date="12 December 2012 - 03:24 PM"><p>
Hi cld! You can set the tooltip for the chart in the onCreate() using helpText doing something like this<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
this.helpText = "Customer Number: "+this.getRowData().getColumnValue("CUSTOMERNUMBER");
</pre>
<br />
Take a look <a class='bbc_url' href='
http://www.birt-exchange.org/org/devshare/designing-birt-reports/443-birt-table-tooltip-examples/'>at
this devshare</a> It has a good example rptdesign. You can extend this even further and use an HTML table as a tooltip, if that's something you might want to use <a class='bbc_url' href='
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1446-html-table-as-a-tooltip-in-a-chart/'>take
a look at this.</a><br /></p></blockquote>
<br />
kclark - Thanks so much for the suuuuuper quick response!
However, wherever is the onCreate() method? Is it in the chart itself? For example, when I open the chart, click the "Script" tab, and then go through the drop down at the top with the different possible functions, I get options like "beforeGeneration()", "beforeDrawDataPointLabel()", etc. but I don't see an "onCreate()". I do see, however, that the dropdown to the left is stuck on "onRender" with no other options - is there where I need to change over to onCreate()?<br />
<br />
Will this let me change the tooltip for each pie slice? (I was thinking if I can GET what's currently in the tooltip, which includes the percentage, split out the percentage, and then reset it as just the percentage for each pie slice, then that's the way to go - would this let me do that?)<br />
<br />
Thanks again, so much!!!!
kenliao
<p>I have the same problem too, is there any solution about this issue?</p>