javascript
  • html
  • charts
  • raphael
  • graphael
  • 2013-11-21 3 views 0 likes 
    0

    Raphy Charts을 계속 사용하려고하는데 "TypeError : 'null'이 (a.style '을 평가하는) 개체가 아닙니다. raphy-chart.min.js : 31 : 452Raphy Charts - TypeError

    <!DOCTYPE HTML> 
    <html> 
        <head> 
        <script type='text/javascript' src='vendor/js/jquery.min.js'></script> 
        <script type='text/javascript' src='vendor/js/raphael.min.js'></script> 
        <script type='text/javascript' src='vendor/js/raphy-charts.min.js'></script> 
        <script> 
         var progress1 = new Charts.CircleProgress('progress-1', 'Sales', 80, 
         { 
         font_color: "#fff", 
         fill_color: "#222", 
         label_color: "#333", 
         text_shadow: "rgba(0,0,0,.4)", 
         stroke_color: "#6a329e" 
         }); 
    
         progress1.draw() 
        </script> 
        </head> 
        <body> 
        <div id='progress-1' style='width: 300px; height: 100px;'></div> 
        </body> 
    </html> 
    

    가 사전에 감사합니다 "

    이 코드 (on Github)입니다!

    +0

    으로 변경 : 시도한 후 div로 이동하십시오. ID를 참조하기 때문에 도움이 될 수 있습니다. progres-1 –

    +0

    감사합니다. Anto. 내가 아래에 설명했던대로 도움이되었습니다. –

    +0

    당신은 오신 것을 환영합니다. –

    답변

    0

    스크립트는 페이지가로드되기 전에 progres-1div을 참조하고 있습니다. 스크립트 div 요소 다음에 이동할 수 있습니다

    <div id='progress-1' style='width: 300px; height: 250px;'></div> 
    
    <script> 
    var progress1 = new Charts.CircleProgress('progress-1', 'Sales', 80, 
    { 
        font_color: "#fff", 
        fill_color: "#222", 
        label_color: "#333", 
        text_shadow: "rgba(0,0,0,.4)", 
        stroke_color: "#6a329e" 
    }); 
    
    progress1.draw() 
    </script> 
    

    높이가 너무 차트의 일부가 보였다 너무 낮게 설정했다. 250px

    +0

    간단하고 결코 나는 결코 그것을 이해할 수 없을 것이다. 시간을 보내고 응답 해 주셔서 대단히 감사합니다! –

     관련 문제

    • 관련 문제 없음^_^