Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Funnel chart using amcharts api
jyothsna.tummala
<p>Hi Team,</p>
<p> </p>
<p>I have developed funnel chart report using the amcharts libraries in ihub 3.1 based on custom visualization item..I have mentioned chart title using the titles property in the funnel itself by giving the hardcoded value.I was able to retrive the funnel successfully.But the question here is, can we replace that hardcoded value with the localization key value mentioned in the properties file?</p>
<p> </p>
<p>Any workaround for this..</p>
Find more posts tagged with
Comments
Clement Wong
<p>The iHub 3.1 Custom Visualizations are executed client side. However, when generating the report, you can add a HTML Text Report Item in the layout to save off the localized string into a JavaScript variable like this:</p>
<pre class="_prettyXprint">
<script>
myTitle = "<VALUE-OF>reportContext.getMessage("welcome", reportContext.getLocale())</VALUE-OF>";
</script>
</pre>
<p>Then, in your Custom Visualization, you can access it in your script.</p>
<pre class="_prettyXprint">
alert(myTitle);</pre>
jyothsna.tummala
<p><span style="font-family:'courier new', courier, monospace;"><span style="font-size:14px;">Hi Clement,</span></span></p>
<p> </p>
<p><span style="font-family:'courier new', courier, monospace;"><span style="font-size:14px;">Thank you for the quick response !!</span></span></p>
<p> </p>
<p><span style="font-family:'courier new', courier, monospace;"><span style="font-size:14px;">The solution you have provided working fine.But, the problem here is,when i tried export content to PDF ,funnel is not rendering because of calling variables declared in Text element in the funnel.Is there any alternative workaround for the issue i am facing.</span></span></p>
<p> </p>
<p><span style="font-family:'courier new', courier, monospace;"><span style="font-size:14px;">Regards,</span></span></p>
<p><span style="font-family:'courier new', courier, monospace;"><span style="font-size:14px;">Jyothsna.</span></span></p>
Clement Wong
<p>OK, didn't know PDF was a desired output format. One workaround I can think of is...</p>
<p> </p>
<p>In the Custom Visualization, there is a Data tab. You can add a new column binding to save off the localized string. Then, in the Script tab, you'll just fetch the saved string via data binding. Then, you can use value however you need.</p>
jyothsna.tummala
<p>Hi Clement,</p>
<p> </p>
<p>Thanks for the reply.</p>
<p> </p>
<p>I have tried the way you mentioned, but i was unable to get the data through binding in the script tab of custom visualization item.Apart from the problem i was facing ,after adding the column binding to the data tab of the custom visualization item,i was facing problem with "Allow Export" property. i.e..while adding column binding i have disabled the allow export option because i don't want that data to be shown in the Export data tab of Interactive viewer.Even after disabling the "Allow Export",still the bindings are shown in the Export Data.</p>
<p> </p>
<p>Any workaround or Working example for the following Problems:</p>
<p> </p>
<p>* I want to set the title of the funnel chart using the localized text from the property file, in the script tab of the custom visualization item using Titles property.</p>
<p>* Allow Export option disable is not working in custom visualization item.</p>
<p> </p>
<p> </p>
<p>Regards,</p>
<p>Jyothsna.</p>
Clement Wong
<p>With BIRT, there are usually a few ways to solve an issue.</p>
<p> </p>
<p>After looking again, there is another workaround without binding a new data column. We can use the Chart's bookmark as the title.</p>
<p> </p>
<p>In the Chart's Template > Script, you can access its bookmark via "this.getBookmark()".</p>
<p> </p>
<p>To set the bookmark, select the Chart. Then, choose the JavaScript expression builder to construct an expression similar to the following:</p>
<pre class="_prettyXprint">
importPackage(Packages.java.util);
var lc = Locale.getDefault();
reportContext.getMessage("myChartTitle", lc);</pre>
<p>I tested this in BIRT Designer Professional iHub 3.1 and am able to get the translated text in the Custom Visualization script.</p>
<p> </p>
<p>
As for the "Allow Export" not working with the other suggested method, I'll submit a ticket with Engineering.</p>
jyothsna.tummala
<p>Hi Clement,</p>
<p> </p>
<p>Thanks for the quick reply.</p>
<p> </p>
<p>Using Bookmark,i was able to set the chart title.Other than Setting title of the funnel ,i was replacing some static text in the custom visualization item with localization text by creating column bindings in the data tab of custom visualization element.Allow export is also another problem i am facing.</p>
<p>Any update regarding the "Allow export".That would be a great help to me.</p>
<p> </p>
<p>Regards,</p>
<p>Jyothsna.</p>
Clement Wong
<p>Unchecking "Allow Export" does not appear to be working in a Custom Visualization. If your company is current on maintenance, then you can follow up with our Support Group as to the status of the product defect ticket (TED 78006).</p>
<p> </p>
<p>Do you need to have "Allow Export" on the Custom Visualization? If not, can you set the <em>Custom Visualization Properties > Advanced > Allow Export</em> to false?</p>
<p> </p>
<p>If you do need "Allow Export" on the entire Custom Visualization, then don't use the custom bindings for the text. Just have the chart title and the static text ALL in the Bookmark, delimited by a character such as ":". Then, you can use JavaScript string's split and index to pull out what you need.</p>
jyothsna.tummala
<p>Hi Clement,</p>
<p> </p>
<p>Thanks for the reply.</p>
<p> </p>
<p>"Allow Export" is needed for entire custom visualization.So,As per your suggestion,I removed all the column bindings and provided the required text in the Bookmark of the chart delimited by ':'.I have split that text in the script tab of the custom visualization item.My requirement is fulfilled and issues also resolved.</p>
<p> </p>
<p>Could you please look into the below thread and suggest me the workaround to achieve that functionality:</p>
<p> </p>
<p><a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/topic/37031-get-chart-type-in-oncontentupdate/'>http://developer.actuate.com/community/forum/index.php?/topic/37031-get-chart-type-in-oncontentupdate/</a></p>
;
<p> </p>
<p> </p>
<p>Thanks in Advance.</p>
<p> </p>
<p>Regards,</p>
<p>Jyothsna.</p>
Clement Wong
<p>Excellent!</p>
<p> </p>
<p>And I've added a reply to the other thread.</p>