You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
vee 81a027a2db k 3 years ago
..
chartConfig.js k 3 years ago
datafeed.js k 3 years ago
datafeed1.js K线 3 years ago
event.js K线 3 years ago
pako.js K线 3 years ago
readme.md K线 3 years ago
websocket.js k线bug修复 3 years ago
websocket1.js K线 3 years ago

readme.md

修改了TradingView 如下源码 //charting_library.min.js //原因是preset: "mobile", 的时候某些工具栏不显示 mobile: { // disabled_features: ["left_toolbar", "header_widget", "timeframes_toolbar", "edit_buttons_in_legend", // "context_menus", "control_bar", "border_around_the_chart" // ], disabled_features: [], enabled_features: [] }

//--library.db04e45ec22f0b637da3.js-- //原因是想把0 .000000000001325 这样的价格格式化成0 .0{11}132 //奈何找不到文档也 cv不了别人代码 熬了一晚上翻的源码直接改 t.prototype._formatAsDecimal = function(t, i) { //格式化价格 if (this.type == "price") { t = 0.00039123 var price = "0.00"; //如果价格大于1则保留2位小数 if (t > 1) { price = t.toFixed(2) } else { //否则 let splitList = t.toString().split(".") let num = 0 if (splitList[1]) { for (var i = 0; i < splitList[1].length; i++) { if (splitList[1][i] == "0") { num++ } else { //如果不为0了 直接中断 break; } } } if (num >= 4) { var last = "" + splitList[1].substring(num, splitList[1].length) if (last.length >= 4) { if (last[4] >= 5) { price = '0.0{' + num + '}' + (parseInt(last[1] + last[2] + last[3]) + 1) } else { price = '0.0{' + num + '}' + last[1] + last[2] + last[3] } } else { price = '0.0{' + num + '}' + last } } else { price = t.toFixed(5) }

    }
	return price
} else {
	var n, r, s, a, l;
	i = i || 0, n = this._fractional ? Math.pow(10, this._fractionalLength || 0) :
        Math.pow(10, i) * this._priceScale / this._minMove, r = Math.floor(t), s = +(
            Math
            .round(t * n) - r * n).toFixed(this._fractionalLength), s >= n && (s -= n,
            r +=
            1), a = "", 1 !== n && (l = void 0 !== this._fractionalLength ? this
            ._fractionalLength : NaN,
            a = e.formatterOptions.decimalSign + o(+s.toFixed(this._fractionalLength) *
                this._minMove, l + i),
            a = this._removeEndingZeros(a, i))
	return "" + r + a
}

}

// 隐藏符号 // r.appendTo(t), this._itemsBinding.push({ value: o, cell: r, source: t.source })