0

少なくとも2つのRaphaelチャートを使用してWebページを作成しています。

どんな助けでも大歓迎です。問題を適切に説明できたと思います。

                <th scope="row">Perl</th>
                <td>3%</td>
            </tr>
            <tr>
                <th scope="row">C++</th>
                <td>2%</td>
            </tr>
            <tr>
                <th scope="row">Java</th>
                <td>2%</td>
            </tr>
            <tr>
                <th scope="row">Objective-C</th>
                <td>2%</td>
            </tr>
        </tbody>
    </table>
</div>
4

1 に答える 1

0

問題はg.pie.jsファイルにあります

あなたはこれをやっています:

$("tr").each(function () { 
  // this loops throught all TR tags in the document, which contains two tables...
  values.push(parseInt($("td", this).text(), 10));
  labels.push($("th", this).text());
});

あなたが「すべき」ことは次のとおりです。

 var table = $("#holder");
  // only select the tr rows that are inside your "holder" div
 $("tr", table).each(function () {
   values.push(parseInt($("td", this).text(), 10));
   labels.push($("th", this).text());
 });

お役に立てれば。間違ったデータセットを円グラフに押し込んでいました。

于 2013-02-22T18:13:54.580 に答える