简体   繁体   中英

Quirks Mode, Dojo Chart/Legend not displaying all the time, Internet Explorer

I have a page that will display ok in Firefox and IE7/IE8 Standards, but not in Quirks Mode or IE9. I need it to also display correctly Quirks. The problem is that the Dojo Chart and Legend 'images' do not display (the Legend labels are there, just not the icons for line colors). I'v tried playing around with the styles but have not yet found one that will make these two items display. Is there something wrong with my current styles? Is my problem with Dojo or Quirks mode? I'm using Dojo 1.5.2.

Something odd that I'v noticed is that if I open the IE Developer Toolbar and untick any of the style boxes (width, padding, position, etc.) then the images will display. It does not seem to matter which box I untick, if I tick it back again, or if the style I pick is even for the chartDiv. The images will display until I refresh the page. I'm not sure what this means or how I can simulate this effect when the page first loads.

var chartContainer = dojo.create("div", {id:"HistoryChart", style:{}}, document.getElementById("HistoryChart"));
var overalChartDiv = dojo.create("div", {style:{clear:"both",width:"850px",height:"300px", margin:"15px 0 0 0"}}, chartContainer);
var chartLabelDiv = dojo.create("div", {style:{float:"left", margin:"75px 0 0 0"}}, overalChartDiv);
var chartDiv = dojo.create("div", {style:{width:"800px", height:"300px", float:"left", margin:"0 0 0 0"}}, overalChartDiv);


    dojo.create("img", {src:"images/label.gif",style:{}}, chartLabelDiv);


    //Create line chart
    var lineChart = new dojox.charting.Chart2D(chartDiv);
    lineChart.addAxis("x", xAxisTheme);
    lineChart.addAxis("y", yAxisTheme);
    lineChart.addPlot("default", {type: "Lines", lines:true, markers:true});
    lineChart.addPlot("grid", {type: "Grid", hMajorLines: true, hMinorLines:false, vMajorLines: false, vMinorLines: false});
    lineChart.addSeries('Avg', avgValues, {legend:"Avg", color:"green"});
    lineChart.addSeries('Max', maxValues, {legend:"Max", color:"red"});
    lineChart.addSeries('Min', minValues, {legend:"Min", color:"blue"});
    var valueTip = new dojox.charting.action2d.Tooltip(lineChart,"default");
    lineChart.render();

    // Create legend
    var legend = dojo.create("div", {style:{}}, chartContainer);
    var led = new dojox.charting.widget.Legend({chart: lineChart, outline: true, horizontal:true, outline:true, style:{margin:"0px 400px"}}, legend);

I have tested in Dojo 1.5.2 but it seems to work fine in recent releases. See: http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/charting/tests/test_legend.html this test is loading fine with IE7/8 in Quircks mode. Not sure what's happening here.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM