No Return Data for flot chart
<p>I wanted to generate a graph but no result is displayed.
This is my controller code:</p>

<pre><code>public dynamic Get(int year)
        {
            var alldata = (from item in db.PT_OrderedList_vw
                           where item.expected_date.Value.Year == year
                           group item by item.expected_date.Value.Month into grp
                           select new
                           {
                               totalPT = grp.Sum(x =&gt; x.totalPT.Value),
                               Month = (double)grp.Max(x =&gt; x.expected_date.Value.Month)
                           }).ToList();
            var final_data = new[]
                {  
                    new { label="Purchase", data = alldata.Select(x=&gt;new double[]{ x.totalPT, x.Month })}

                };

            final_data;
        }
</code></pre>

<p>View:</p>

<pre><code>&lt;section style="width: 500px; margin: 10px; text-align:center;"&gt;
    &lt;div id="placeholder" style="width: 500px; height: 300px;"&gt;&lt;/div&gt;
    &lt;h3 style="font-size:1.4em"&gt;Traffic Overview - 2012 &lt;/h3&gt;
&lt;/section&gt;
</code></pre>

<p>Script which I put above the view page:</p>

<pre><code>&lt;script&gt;
    var dataurl = 'Get/';
    // setup plot
    var options = {
        legend: {
            show: true,
            margin: 10,
            backgroundOpacity: 0.9
        },
        points: {
            show: true,
            radius: 3
        },
        lines: {
            show: true
        },
        grid: { hoverable: true, clickable: true },
        yaxis: { min: 0, tickFormatter: formatter },
        xaxis: { ticks: [[1, "Jan"], [2, "Feb"], [3, "Mar"], [4, "Apr"], [5, "May"], [6, "Jun"], [7, "Jul"], [8, "Aug"], [9, "Sep"], [10, "Oct"], [11, "Nov"], [12, "Dec"]] }

    };
    function formatter(val, axis) {
        return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
    }
    $.ajax({
        url: dataurl,
        method: 'GET',
        data: { year: 2016 },
        dataType: 'json',
        success: function (data) {
            $.plot($("#placeholder"), data, options);
        }
    });


    var previousPoint = null;
    $("#placeholder").bind("plothover", function (event, pos, item) {
        if (item) {
            if (previousPoint != item.dataIndex) {
                previousPoint = item.dataIndex;

                $("#tooltip").remove();
                var x = item.datapoint[0],
                    y = item.datapoint[1].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
                showTooltip(item.pageX, item.pageY, item.series.label + ": " + y);

            }
        }
        else {
            $("#tooltip").remove();
            previousPoint = null;
        }
    });


    function showTooltip(x, y, contents) {
        $('&lt;div id="tooltip"&gt;' + contents + '&lt;/div&gt;').css({
            position: 'absolute',
            display: 'none',
            top: y + 5,
            left: x + 5,
            border: '1px solid #fdd',
            padding: '2px',
            'background-color': '#fee',
            opacity: 0.80
        }).appendTo("body").fadeIn(200);
    }
&lt;/script&gt;
</code></pre>

<p>Result:</p>

<p>I need to generate a graph for this one but it displayed nothing.
This is my first time to do it and no idea whats wrong on this code. I have just research everything and follow some steps google provide.</p>

<p>I need advice or suggestions so that I can achieve this Graph. </p>