Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
316 views
in Technique[技术] by (71.8m points)

laravel - Getting metrics graph to display the graph in vue

I'm using vue and laravel and I'm trying to get metrics-graphics chart to display a chart. The issue I'm having is that it seems that the data gets pulled through but it doesn't seem display and there is nothing in the console.

Here is my code

    d3.json('/api/chart', function(data) {
        console.log('im here');
        for (var i = 0; i < data.length; i++) {
            data[i] = MG.convert.date(data[i], 'date');
        }

        MG.data_graphic({
            title: "Basic Brushing & Zooming",
            description: "This is a simple example of brushing and zooming. You can set 'brush' as 'xy', 'x', 'y' to specify the axis(es) that may be brushed.",
            data: data,
            top: 70,
            width: 600,
            height: 240,
            right: 40,
            missing_is_hidden: true,
            target: '#chart',
            brush: 'xy',
        });
    });

and in my Network tab this is what my preview shows

chart: "[{"date":"2014-01-01","value":150000000},{"date":"2014-01-02","value":168799730},{"date":"2014-01-03","value":179473940}]"

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...