chxj1992 / kline

一个 javascript K线插件. A K line library written in javascript.
Do What The F*ck You Want To Public License
793 stars 337 forks source link

Data loading issue and width problem #86

Open jitendraas opened 6 years ago

jitendraas commented 6 years ago

I have an issue for data loading for this I directly pass the data in data property of kline chart but it unable to load graph it just showing Loading.... Should it required to fetch graph data from GET url? If I directly append data in kline so what was the issue for not viewing, reply. Data is showing I know its not complete but it unable to view anything in chart panel. screenshot from 2018-09-29 16-12-09

And for the width for stylying graph to 100% is not making change it does constant width and height that defines while initialization of graph properties, how am I fix this?.

xuechunpeng01 commented 5 years ago

How did you solve the problem?

jitendraas commented 5 years ago

Following code base which I have used,

  var kline = new Kline({
    element: "#kline_container",
    width: 1200,
    height: 650,
    theme: 'dark', // light/dark
    language: 'en-us', // zh-cn/en-us/zh-tw
    ranges: ["1w", "1d", "1h", "30m", "15m", "5m", "1m", "line"],
    symbol: "BTC",
    symbolName: "BTC/USD",
    type: "poll", // poll/socket
    url: "/assets/mock.json",
    limit: 1000,
    intervalTime: 5000,
    debug: true,
    showTrade: true,
    disableFirebase: true,
    onResize: function(width, height) {
        console.log("chart resized: " + width + " " + height);
    }
});

kline.draw();
kline.toggleTrade();