I created a plot in javascript and wanted to show a legend for the plot overlapping the plot. The function creating this plot doesn't allow an overlapping legend directly, but it leaves you the possibility to place the legend in a separate div. So I made these two divs:
<div id="ContainingLegend">
<div id="VariablePlotLegend">
</div
</div>
So the legend will the placed in the div VariablePlotLegend.
Here are my two relevant CSS parts:
#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;
}
On screen the legend is shown perfectly. On print it is shown below the plot on the left, in all black with no border etc. Why?