It is currently Tue Jul 29, 2014 12:42 pm Advanced search

Chart Title to appear in front of data/grids

Technical support, bug reports and more.

Chart Title to appear in front of data/grids

Postby tome » Fri Feb 24, 2012 9:03 am

I'm using a floating title within my grid. Unfortunately, my chart titles are rendered behind grid lines and chart data. Is there any way to have my title appear in front of chart data and grid lines? I was hoping for something like zIndex, but I don't think it exists for title.

Here is an example of the chart title behind grid and data:
http://jsfiddle.net/tome/jCdVY/

Thanks!
tome
 
Posts: 20
Joined: Wed Feb 15, 2012 11:14 pm

Re: Chart Title to appear in front of data/grids

Postby tome » Fri Feb 24, 2012 9:48 am

I found that I can do this in javascript by re-appending the .highcharts-title element to the svg. It's pretty ugly, so I hope highcharts has a better way of doing this. But I do have a workaround.
-- Edit:
For some reason this re-appending doesn't work in my phantomjs environment (but does work in jsfiddle). So a highcharts-native fix is even more useful now.
tome
 
Posts: 20
Joined: Wed Feb 15, 2012 11:14 pm

Re: Chart Title to appear in front of data/grids

Postby hfrntt » Tue Feb 28, 2012 1:06 pm

Well it's not possible to do using settings, but you can try to bring chart to front in chart load event (it's almost the same thing you did before, but it's important to call it in load event), here is the sample code:
Code: Select all
events: {
    load: function(){
        this.title.toFront();
    }
}

See: http://jsfiddle.net/jCdVY/6
Slawek Kolodziej
Highcharts support team
hfrntt
 
Posts: 6394
Joined: Mon Aug 30, 2010 10:41 am

Re: Chart Title to appear in front of data/grids

Postby tome » Tue Feb 28, 2012 6:01 pm

Thanks! This is much cleaner, but still doesn't work for my use case.

Unfortunately neither this nor my previous attempt (which used the two parameter calling style for Chart construction to manipulate the SVG directly) work when doing svg export using phantomjs, though both seem to work when rendering in jsfiddle.

I've got a bit of investigation to do about that. Not sure if the events aren't getting fired or if there is something else going on.
I'll keep digging.
tome
 
Posts: 20
Joined: Wed Feb 15, 2012 11:14 pm

Re: Chart Title to appear in front of data/grids

Postby tome » Tue Feb 28, 2012 7:14 pm

Looking at the SVG export module, it appears to actually recreate the chart.
If that is true, then these types of SVG/toFront manipulations won't work unless they are backed by a highcharts setting.

Does it make sense to register this as a feature request or bug of highcharts or the export module?
tome
 
Posts: 20
Joined: Wed Feb 15, 2012 11:14 pm

Re: Chart Title to appear in front of data/grids

Postby tome » Tue Feb 28, 2012 11:36 pm

I confirmed that modifying export.src.js and adding:
chartCopy.title.toFront();

before the line:
svg = chartCopy.container.innerHTML;

Results in the title properly appearing in front. Would love to see that as the default or a feature, since we really don't want to maintain our own version of the export module.

Thanks for all the help thusfar!
tome
 
Posts: 20
Joined: Wed Feb 15, 2012 11:14 pm

Re: Chart Title to appear in front of data/grids

Postby grtvrt » Mon Mar 05, 2012 1:03 pm

Hi Tome,

I agree it's unlogical to have a floating chart title behind gridlines. We could fix this by implementing an option for specifying z-index on this element. I submitted an issue for this on Github, see https://github.com/highslide-software/h ... issues/804

Best regards,

Gert Vaartjes
Highsoft Solutions
grtvrt
 
Posts: 154
Joined: Thu Apr 14, 2011 8:03 am


Return to Highcharts Usage

Who is online

Users browsing this forum: Google [Bot], seba and 13 guests