jQuery の jqPlot で作る、ドラッグでポイントを移動できる折れ線グラフ

jQueryのjqPlotプラグインで作る、折れ線グラフにおいて、折れ線グラフのポイントをドラッグで移動できるようにする方法。

実装例(サンプル)

実装例(サンプル)のソースコード

読み込み

パスは、それぞれ、アップロードした場所を指定する。

<script language="javascript" type="text/javascript" src="jquery-1.7.1.min.js"></script>
<!--[if lt IE 9]>
    <script language="javascript" type="text/javascript" src="excanvas.min.js"></script>
<![endif]-->
<script language="javascript" type="text/javascript" src="jquery.jqplot.min.js"></script>
<script language="javascript" type="text/javascript" src="plugins/jqplot.dragable.min.js"></script>
<link rel="stylesheet" type="text/css" href="jquery.jqplot.min.css" />

読み込むファイル。

JavaScript

<script>
jQuery( function() {
    jQuery . jqplot . config . enablePlugins = true;
    jQuery . jqplot(
        'jqPlot-sample',
        [
            [ [ 1, 65 ], [ 2, 72 ], [ 3, 74 ], [ 4, 63 ], [ 5, 85 ], [ 6, 70 ] ]
        ]
    );
} );
</script>

HTML

<div id="jqPlot-sample" style="height: 300px; width: 300px;"></div>

スポンサード リンク

カテゴリー: dragable, JavaScript, jqPlot, jQuery, グラフ、チャート, プラグイン, 線グラフ パーマリンク