Hi, I have used cewolf area chart to create a stacked area chart.
My dataset comprises of 3 categories. The first category drawn; "scope 1" is drawn as scope 1 + scope 2 + scope 3, scope 2 is then drawn as scope 2 + scope 3 and finally scope 3 is drawn simply as scope 3 to create the stack. The chart displays perfectly but the problem comes when I look at the tooltips and the links, no matter where I place the cursor it will always display the tooltip/link for scope 1.
I assumed as scope 2 was drawn on top of scope 1 and scope 3 on top of scope 2 that the area drawn last would be the one that displays the tooltip and link but this doesn't appear to be the case. Is there anything that I can do to alter this?
An example of my cewolf:
My data producer retrieves the relevant data per month for all 3 scopes and displays them as scope 1, then the data for scope 2 and 3 and displays them as scope 2 and finally displays scope 3 data as scope 3.
The generate link method in graphStackTest simply returns the name of the series and the tooltip generator returns the series name, category name and tco2e value.
If you place your cursor over the green area on the graph below the tooltip and link for the red area behind are still generated.
The problem is that the areas are overlapping, and in that case it's not clear which definition should be used for the tooltip. For example, the area in green is also part of the area in red that looks like it's "behind" it, because both begin at y=0. It probably goes in the order in which they are defined (red -> blue -> green in your case).
What should probably happen is that tooltips only pop up in the vicinity of actual data points, not all over the areas. That's hwat happens with line charts. Replace type="area" by type="line" to see the difference.
posted 9 years ago
Thanks for the response,
I know the origin of the issue, I was just wondering if there was a way to change the behaviour of the tooltip/link generators.
I need the graphs to be displayed as stacked areas, a stacked line chart would be misleading in this case
I defined the categories in my producer class in the opposite order, but now, instead of just showing the link for the red category it now just displays the tooltip for the green category. Even on the sections where you cannot see the green category, which is even more strange behaviour.
On further inspection...
The categories are reversed but as the red category must be drawn first (otherwise it draws on top of the other categories) it doesn't matter what order the categories are defined as the red category is still treated as the first by the tooltip and link generators. It appears as though the green tooltip is being shown as it retrieves the series name from the definition not the dataset. If I use the dataset passed to the tooltip generator to print out the series name it, again, only shows the red category.
I'm beginning to think that this is something that is impossible to achieve which is disappointing. If there is anything else that you could suggest it would be greatly appreciated.
posted 9 years ago
Oh and by the way, if I draw the categories in the opposite order (and therefore only the red category is shown) all the tooltips are visible. So where the green category is, but cannot be seen, the tooltip for it is shown.
And then the entire population worshiped me like unto a god. Well, me and this tiny ad: