代码之家  ›  专栏  ›  技术社区  ›  GoinOff

缺少Dojo 1.5.0图表图例

  •  0
  • GoinOff  · 技术社区  · 15 年前

    其他人有这个问题吗??

    我一直收到以下错误:

    此错误发生在

    chart1.render()//Graph显示但error导致该javascript函数中的其余代码不执行(因此,不是legend,因为它是在chart1.render()之后创建的);线路。

    2 回复  |  直到 15 年前
        1
  •  0
  •   Eugene Lazutkin    15 年前

    图表测试对你有用吗?去 Dojo Nightly Charting Tests 并选择一个使用工具提示的测试,例如。, test_event2d.html . 如果它适合你,看看你的设置有什么不同。如果您发现了差异,并且它与Dojo有关,请 file a bug . 别忘了提到你使用的浏览器,并附上一个简单的测试用例作为一个文件。

        2
  •  0
  •   GoinOff    15 年前

    发现了问题 Dojo Nightly Charting测试代码和Dojo版本1.5.0(任何web浏览器):

    注意

    警告 :下面代码部分的HTML没有100%正确显示,但是所有javascript代码都存在,可以很容易地重新创建此问题。

    :感谢您提供测试页面的链接,这很有帮助。另外,我是否应该对此提交一份错误报告??

        
    
    
    
    
    Event 2D
    
     @import "dojo-release-1.5.0/dojo/resources/dojo.css";
     @import "dojo-release-1.5.0/dijit/tests/css/dijitTests.css";
    
    
    
    
    .dojoxLegendNode {border: 1px solid #ccc; margin: 5px 10px 5px 10px; padding: 3px}
    .dojoxLegendText {vertical-align: text-top; padding-right: 10px}
    
    
    
    
    dojo.require("dojox.charting.Chart2D");
    dojo.require("dojox.charting.themes.PlotKit.green");
    
    dojo.require("dojox.charting.action2d.Highlight");
    dojo.require("dojox.charting.action2d.Magnify");
    dojo.require("dojox.charting.action2d.MoveSlice");
    dojo.require("dojox.charting.action2d.Shake");
    dojo.require("dojox.charting.action2d.Tooltip");
    
    dojo.require("dojox.charting.widget.Legend");
    
    dojo.require("dojo.colors");
    dojo.require("dojo.fx.easing");
    
    var dc = dojox.charting;
    
    var dur = 450;
    var chart1;
    
    makeObjects = function(){
     chart1 = new dc.Chart2D("test1");
     //chart1.setTheme(dc.themes.PlotKit.green);
     chart1.addPlot("default", {type: "Default", lines: true, markers: true, tension:2});
            chart1.addPlot("other",  {type: "Lines",
        hAxis: "other x",
        vAxis: "other y"
       });
     chart1.addPlot("grid",  {type: "Grid",
                 hMajorLines: true,
               hMinorLines: false,
               vMajorLines: true,
               vMinorLines: false
       });
     chart1.addAxis("x", {min: 0, max: 6, majorTick: {stroke: "black", length: 3}, minorTick: {stroke: "gray", length: 3}});
     chart1.addAxis("y", {vertical: true, min: 0, max: 10, majorTick: {stroke: "black", length: 3}, minorTick: {stroke: "gray", length: 3}});
     chart1.addAxis("other x", {leftBottom: false, min: 0, max: 6, majorTick: {stroke: "black", length: 3}, minorTick: {stroke: "gray", length: 3}});
     chart1.addAxis("other y", {leftBottom: false, vertical: true, min: 0, max: 10, majorTick: {stroke: "black", length: 3}, minorTick: {stroke: "gray", length: 3}});
     chart1.addSeries("Series A", [{x: 0.5, y: 5}, {x: 1.5, y: 1.5}, {x: 2, y: 9}, {x: 5, y: 0.3}]);
     chart1.addSeries("Series B", [{x: 0.3, y: 8}, {x: 4, y: 6, tooltip: "Custom tooltip"}, {x: 5.5, y: 2}], {plot: "other"});
     var anim1a = new dc.action2d.Magnify(chart1, "default");
     var anim1b = new dc.action2d.Tooltip(chart1, "default");
     chart1.render();
     chart1.render();
     var legend1 = new dojox.charting.widget.Legend({chart: chart1, horizontal: false}, "legend1");
    
    };
    
    dojo.addOnLoad(makeObjects);
    
    
    
    
    

    Event 2D

    Go-->

    Hover over markers, bars, columns, slices, and so on.

    1: Markers, lines, 2D data, custom axis. Actions: Magnify, Tooltip.

    That's all Folks!

    推荐文章