Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here our the two function which you can use:</p> <pre><code>function graphLegendCreation(cnt){ var parentNode = _g("dmGraphLegend")//trying to get the div element with id dmGraphLegend , newLegendItemNode = Util.ce("span") //creating an span element , newLegendItemSelect = Util.cep("input", { //creating an input element "type":"checkbox", "name":"graphLegend", "checked":true, "value":cnt }) , newLegendItemIconNode = Util.cep("canvas", { "id":"series_icon_"+cnt, "className":"series_icons" }); newLegendItemIconNode.style.display = "inline-block"; newLegendItemIconNode.style.position = "relative"; if(parentNode) { newLegendItemNode.innerHTML = graphPlot.series[cnt].label; newLegendItemSelect = Util.ac(newLegendItemSelect,parentNode); newLegendItemSelect.checked = true; Util.addEvent(newLegendItemSelect,"click", function(e) { graphPlot.series[this.value].show = newLegendItemSelect.checked; graphPlot.redraw(false); }) newLegendItemIconNode = Util.ac(newLegendItemIconNode,parentNode); newLegendItemNode = Util.ac(newLegendItemNode,parentNode); Util.ac(Util.ce("br"),parentNode); } } function showlegend() { var cntr = 0 ,len = 0 ,iconNodes ,legendItemIconNode ,seriesSequence = 0 ,context ,bMarker; iconNodes = Util.Style.g("series_icons"); len = iconNodes.length; for(cntr = 0; cntr &lt; len; cntr++) { legendItemIconNode = iconNodes[cntr]; if ($.browser.msie) { G_vmlCanvasManager.initElement(legendItemIconNode); } context = legendItemIconNode.getContext('2d'); bMarker = new nMarkerRenderer({ size:8, color:graphPlot.series[cntr].color, style:graphPlot.series[cntr].markerOptions.style }); bMarker.draw(12,12,context, {}); } } </code></pre> <p>CSS: .series_icons{width:20px;height:20px;}</p> <p>GraphLegendCreation function you have to call that each time you create a entry inside legend. ShowLegend is just going to create that legend icons.</p> <p>The "nMarkrenderer" is already a defined function. Get that function from <a href="http://jsfiddle.net/mbqJt/" rel="nofollow">jsfiddle file</a></p> <p>Let me know you want more help with this. It works for sure on IE. tried and tested</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload