Focal Point
[SOLVED] Drill Down off of a Graph Legend

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5901007772

March 25, 2008, 04:53 PM
<Tmproff>
[SOLVED] Drill Down off of a Graph Legend
I was wondering if anyone knew how to make the legend of a line graph the drill down.

I have no problem getting the actual line to be the drill down using the code:

TYPE=DATA, TARGET='_blank', FOCEXEC=summary_drill_down(REGION=REGION),$  


Thanks for your help
-Troy

This message has been edited. Last edited by: <Kathryn Henning>,
March 10, 2014, 02:51 PM
HCP
I am curious if anyone ever did this... create a drill down from the legend of a line graph? Anybody?


Webfocus 7.7.2
Windows, HTML, PDF, and Excel
March 11, 2014, 03:07 PM
Sandy Stulberger
Troy and HCP,

I am also curious about has anyone managed to make this happen and more importantly how or why.
In other words, how would you make use of this capability if it existed.

I have also requested this a while back and as far as I know the capability does not exist.
But there is a work around as I will show below.

So Troy, here is the code you posted...

TYPE=DATA, TARGET='_blank', FOCEXEC=summary_drill_down(REGION=REGION),$

The implication of your code is that you only have one series like Sales over Region or Units over Region.
I’m going to make believe that your chart shows Sales, Cost and Profit over Region.
I'm also going to amend your scenario by adding a WHERE statement for YEAR inside your chart:
Therefore, within your chart code you would have:

SUM SALES
COST
PROFIT
BY REGION
WHERE YEAR EQ &YEAR;
That would change your drill down code to look like.

TYPE=DATA, COLUMN= N2, TARGET='_blank', FOCEXEC=summary_drill_down(REGION=REGION YEAR=&YEAR.QUOTEDSTRING),$

The COLUMN=N2 is because you are drilling down from the Sales series as opposed to Cost or Profit.
The YEAR=&YEAR.QUOTEDSTRING is because my presumption here is your current chart caused you to select a year and you are going to pass that same year to the summary_drill_down procedure which also has a WHERE YEAR EQ &YEAR statement.

Now with all this your chart would have three legend labels: Sales, Cost and Profit.
Then it would be even more enticing to want to click on a legend label to see a drill down on a specific series. Although there is no drill down directly from the legend labels (as far as I know), you can still accomplish the same thing.

So here comes the work around…
You can still accomplish the same thing via multi-drill as follows:

TYPE=DATA,
COLUMN= N2,
TARGET='_BLANK',
DRILLMENUITEM='Sales, Cost, Profit For This Region',
FOCEXEC=summary_drill_down( \
REGION=REGION \
YEAR=&YEAR.QUOTEDSTRING \
),
DRILLMENUITEM='Sales Analysis By Product Type',
FOCEXEC=sales_analysis_report( \
YEAR=&YEAR.QUOTEDSTRING \
),
DRILLMENUITEM='Cost Analysis By Product Type',
FOCEXEC=cost_analysis_report( \
YEAR=&YEAR.QUOTEDSTRING \
),
DRILLMENUITEM='Profit Trend Chart',
FOCEXEC=profit_trend_chart( \
YEAR=&YEAR.QUOTEDSTRING \
),
$

When you run and drill down on any point on the sales series (in this example) you will now see a menu.
The first choice will take you exactly to where you are now. The other three will run procedures that are for the entire series (Sales or Cost or Profit) independent of which x-axis label (i.e. which Region) you were over.

This message has been edited. Last edited by: Sandy Stulberger,
March 12, 2014, 09:22 AM
HCP
Thanks Sandy... I'm not sure if your solution will work for our issues. We are still in the planning process for a chart that our users want. We anticipate that there will be intervals where the lines are overlayed and/or very close together making it harder for the user to drill down for a specific line. By allowing them to drill down from the legend they can more easily pick which item they are drilling down on.

Since we are still working on the design I wanted to find out if drilling down from a legend was even possible.


Webfocus 7.7.2
Windows, HTML, PDF, and Excel
March 13, 2014, 01:42 PM
Sandy Stulberger
HCP... I fully understand that if you have a line chart with let's say two series such as Sale and Cost. Then there may be situations when the lines overlap (i.e. the sum of Sales is exactly the same as the sum of Cost).

However, you still have other options that would make it possible to distinguish between Sales vs Cost. If you could consider using a bar chart instead, then the series will be clustered along side of each other. In such a chart there will be no problem clicking on either the Sales bar or the Cost bar.

You might even want to consider a Bar, Line, Area combination. These will also make it easier to distinguish between the series and make it easier to pick which series and which data point in the series to drill down.

Remember, if you were to drill down on a series legend, then that drill down would need to be for the entire series.

When you drill on a chart value you are also specifying where that series is over the X-Axis. In other words, your drill down can also pass the X-Axis value; weather that is Region or Month or Year-Month.

This message has been edited. Last edited by: Sandy Stulberger,