Home
Analytics
Drill-Through Hyperlink on X-Axis label
hlocas
Hello,
I am designing a Bar Chart on which the values on the X-Axis are days of a specified month. The dates are coming from a row in the databases from which i pull my data. So each label on the X-Axis is a day of the month like "01", rather than the full time stamp that is in the DB. A sample of the chart would look like the attached image.
I would like to have a drill-though link to open another report on the X-Axis labels and pass the date that was clicked as a report parameter. For example, I am viewing the chart for the month of February 2011 and I click on the X-Axis label "21". I would like to load a sub report passing "2011-02-21" as report parameter.
So far, I can build my link and things seem to work fine with an hard-coded date... but I cannot find a handle on what day was clicked in order to load the sub report for the proper date.
Thanks in advance,
Hugo
Find more posts tagged with
Comments
mwilliams
Hi Hugo,
Do you use a parameter to determine which month and year the report will be for? If so, you could use this parameter along with the value from the x-axis to build a new date value to pass through your drill through.
Let me know.
hlocas
Hi,
thanks for replying. Yes I do use a parameter (in fact right now I am using a startDate and an endDate parameters). But just to be clear, my difficulty is not in "re-building" the full date, but rather how to access the value that was clicked on the X-Axis when building my URL. To ease discussion and to keep things simple, I changed the format of my X-Axis values to be the full date (see my updated screeshot).
Now in the Hyperlink options (from Format Chart/X-Axis/Interactivity/Mouse Click/Edit Base URL). I chose a report design to be the target report. In the table for report parameters I am trying to use the Expression Builder to set a value for a "Date" parameter based on the date that was cliked on the X-Axis. So far I cannot find a way to get that value.
Also please note that I am using BIRT 2.5.2.
Hugo
mwilliams
Hugo,
Can you recreate what you're trying to do with the sample database?
hlocas
Hi,
Yes I can... Anything I put on the X-AXIS with an hyperlink on the labels I don't seem to have access to the value when it comes to injecting a parameter into a sub report.
Hugo
pricher
Hi Hugo,
As far as I know, Format Chart/X-Axis/Interactivity lets you add interactivity for the whole X-axis, not for each label underneath the axis.
What you are attempting to do can be done with Format Chart/Value (Y) Series/Interactivity. In that case the whole bar will become clickable, and you will be able to pass a date value to your drill-down report.
I have created an example using the Sample database to show how it works. The chart in DateHyperlinkMaster calls DateHyperlinkDetail and runs the report for the bar you clicked on.
Hope this helps!
P.
hlocas
Hi P,
thanks for the reply. I was scared that was going to be the answer. I really needed the links to be on the labels. I have other plans for the bars
. I find odd though that there is a link on each label that only gives interactivity on the whole Axis.
I will try to find another way, but thanks anyway.
Hugo
hlocas
Hi,
is there a way to access the value of the label that was clicked from a script? For example, if I use the chart from my last screen shot, if I click on the first label on the X-Axis (2011-02-21) can I get the string "2011-02-21" from context variable in a script that I could use from the MouseClick Event?
Thanks,
Hugo
mwilliams
Hugo, I don't think you can access the x-axis value clicking on the axis. That information is available when clicking on the plot only, from what I have seen. You could always request and enhancement to be able to click on the indidvidual labels and have access to the label information at
http://www.birt-exchange.org/org/resources/bug-reporting/
suk
Hugo,
I have a similar requirement. Were you able to figure out how to add the hyperlinks to the labels? Wondering if I could use the before generate event to grab the labels and set them as hyperlinks. The thought is once I have the hyperlink created then I can call my own custom javascript/URI to perform the drill through.
Any help is appreciated.
Thanks
Suk
hlocas
Hi Suk,
I was never able to do what I intended with the label hyperlinks. I ajusted my requirements and went another path to display my data. That said, it possible to set hyperlinks on the axis labels, my issue was that I needed to access a dataset row to inject into a parameter for a sub-report. It seems that it is not supported at the moment.
As for what you are thinking to do, I believe it possible to call a custom javascript using a regular hyperlink (URI instead of Drill-through). I guess the matter would be then to generate the javascript call with the required data for the drill-through. I am not sure I understand what you are suggesting to grab the data though. Also I am not aware of a "before generate event"...
I thinks the elements you are bringing to the discussion are interesting and I hope that someone with more knowledge on the matter can comment.
Keep me posted,
Hugo