I have successfully created a javascript plot and wanted to incorporate a legend that overlaps the plot. Unfortunately, the function I used does not support directly overlapping legends, but it does allow for placing the legend in a separate div. To work around this limitation, I created two separate divs:
<div id="ContainingLegend">
<div id="VariablePlotLegend">
</div
</div>
Therefore, the legend will be positioned within the div named VariablePlotLegend.
Below are the relevant CSS styles I applied:
#ContainingLegend{
text-align: center;
margin-top: -73px;
margin-left: 60px;
margin-right: 10px;
}
#VariablePlotLegend{
padding: 3px;
border-color: #004790;
border-width: 1px;
border-style: solid;
background: #FFFFFF;
width: auto;
display: inline-block;
position:relative;
z-index:10;
}
Although the legend is perfectly displayed on screen, when printed, it appears below the plot on the left side, entirely in black without any borders. This unexpected behavior raises the question - why?