Flot charts: markings z-index? -


is there way access , manually set z-index (for lack of better word) of markings lines in flot chart? right creating markings on line chart use thresholds (basic horizontal lines set specific value) , it's working great except when markings happen lined chart's grid lines. when happens grid line overlaps marking line it's hard see marking line. manually set marking line on top of grid lines, can't figure out set option (or if it's possible).

here markings array creating (dynamically):

markings: [ { y2axis: {from: -20, to: -20}, color: "#848484", linewidth: 2.5 },{ y2axis: {from: -12, to: -12}, color: "#848484", linewidth: 2.5 } ] 

here image of result (you can see threshold @ -12 buried under chart's gridline , appears 2 thinner lines): enter image description here

thanks or advice can offer!

when drawing on canvas there no z-order. drawn later drawn on older stuff. , when @ flot code (in drawgrid() function) see markings drawn first.

there few different solutions / work-arounds here:

  1. you make local copy of jquery.flot.js file , change code markings drawn last in drawgrid() function.
  2. you remove markings , instead generate simple data series 2 endpoints , add dataset (preferably before real data series). markings data series drawn after grid , before real data series.
  3. you draw markings manually after flot draws grid , before flot draws plot data. (see documentation.)

Popular posts from this blog