Home forums Feature Requests & Feedback Feature request: Grid lines over area fill

This topic contains 4 replies, has 2 voices, and was last updated by  Eesger 3 months, 1 week ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #12170

    Eesger
    Member

    In my case it would be great if I could get the gridlines on top of the area fills. Now the gridlines are behind the area fill. In some cases (at least in my case) it could make a chart better readable when the (horizontal) grid lines would be better visible by placing them OVER the fill (not BEHIND the fill).

    • This topic was modified 3 months, 1 week ago by  Eesger.
    • This topic was modified 3 months, 1 week ago by  Eesger.
    #12253

    Vishwas R
    Keymaster

    Eesger,

    As of now we don’t have this feature. But you can work around by setting fillOpacity to 0.7 or 0.8 to make gridlines visible through dataPoints. Check this jsfiddle.

    Another option is to place stripLines with showOnTop set to true, so that lines are shown on top of data. Check this jsfiddle.

    #12254

    Eesger
    Member

    The fillOpacity is not an option in my case. Placing of the stripLines is a good idea. However, my Chart renders with an automatic grid line interval, I cannot detect the current (automatic) interval can I?

    #12256

    Eesger
    Member

    It was a bit of programming, but I thought of a solution:

    – use a stackedArea
    – subtract the stacked value
    – set fillOpacity of the base value to zerro
    – custom toolTip (add the other value)

    function makeStacked(stack,base) {
    	if (stack.length != base.length) { alert('makeStacked: '+stack.length+' != '+base.length); return stack; }
    	var stacked = [];
    	for (var i = 0; i < stack.length; i++) {
    		stacked[i] = stack[i];
    		stacked[i].y = stack[i].y - base[i].y;
    	}
    	return stacked;
    }
    #12279

    Eesger
    Member

    I have the strangest thing now, since I am using ‘stackedArea’ I now have with a large dataset (and includeZero:false) that when a have a relative low value in the past and zoom in on a point “later in time” the “low value” is the low value of the complete dataset, not just of the zoomed part (so the zoom is now a bit messed up..).

    I am working on quite a complex chart. But I’ll try to build a fiddle so you may be able to fix the bug

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.