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.
 
 
 

137 lines
4.3 KiB

import {
FeedBase
} from './datafeed.js'
// new UDFCompatibleDatafeed('https://demo-feed-data.tradingview.com')
var chartConfig = {
// debug: true,
width: 0, //宽度
height: 0, //高度
//....
autosize: false, //自适应宽高
fullscreen: false, //布尔值显示图表是否占用窗口中所有可用的空间。
//如果上面参数开启会影响到宽高项
timeframe: '1',
timezone: "Asia/Bangkok",
intervals: ['1', '5', '15', '30', '60', '1D', '1W', '1M'],
container: "kline",
datafeed: new FeedBase(),
library_path: "./static/charting_library/",
locale: "en",
loading_screen: {
"backgroundColor": "#1e222d",
"foregroundColor": "#ffffff"
},
theme: 'Dark',
//#ifdef APP-PLUS
preset: "mobile",
//#endif
//禁用功能
disabled_features: [ // 需要屏蔽掉的 参考 https://tradingview.gitee.io/featuresets/
"widget_logo", //LOGO
"header_resolutions",
"left_toolbar",
"header_screenshot",
"header_fullscreen_button",
"header_undo_redo",
"header_indicators",
"header_symbol_search", // 搜索
'symbol_search_hot_key',
"header_saveload", // 上传下载按钮
"header_compare", //compare
"volume_force_overlay", // k线与销量分开
'header_interval_dialog_button',
'show_interval_dialog_on_key_press',
"legend_context_menu",
"edit_buttons_in_legend",
'dont_show_boolean_study_arguments',
"save_chart_properties_to_local_storage",
"use_localstorage_for_settings",
"display_market_status",
"fix_left_edge",
"timeframes_toolbar", // 底部时间栏目
//#ifdef APP-PLUS
"source_selection_markers",
// "chart_zoom",//图表缩放
'pane_context_menu', // 图表右键菜单
// "header_widget",
// 'header_widget_dom_node', // 顶部工具栏
"header_screenshot", // 照相机按钮
// "header_chart_type", // 图标类型按钮
// "header_undo_redo", // 左右箭头
// "header_resolutions", // 分辨率
// "property_pages",
// "control_bar", //图表左移、右移 放大 缩小 工具
"go_to_date", //前往到某个时间
// "left_toolbar", // 左侧栏
"header_fullscreen_button", //全屏
// 'header_indicators', // 技术指标
// "border_around_the_chart", //边框环绕
//#endif
],
//启用名称的数组
enabled_features: [
"move_logo_to_main_pane",
"keep_left_toolbar_visible_on_small_screens", //防止左侧工具栏在小屏消失
"seconds_resolution", //支持秒的周期
"hide_left_toolbar_by_defaut", //第一次打开隐藏左侧工具
"hide_last_na_study_output", //隐藏 n/a
],
custom_css_url: "./css/tradingview.css",
studies_overrides: {
"volume.precision": 0,
// 销量线
"volume.volume.color.0": "#d64b62",
"volume.volume.color.1": "#08ab90",
},
overrides: {
// 蜡烛样式
"mainSeriesProperties.candleStyle.upColor": "#08ab90",
"mainSeriesProperties.candleStyle.downColor": "#d64b62",
// 画布背景颜色
"paneProperties.background": "#ffffff",
//纵向网格线颜色
"paneProperties.vertGridProperties.color": "#1f2943",
//横向网格线颜色
"paneProperties.horzGridProperties.color": "#1f2943",
//刻度属性文本颜色
"scalesProperties.textColor": '#61688a',
// 设置坐标轴字体大小
//#ifdef APP-PLUS
'scalesProperties.fontSize': 12,
//#endif
//#ifdef H5
'scalesProperties.fontSize': 12,
//#endif
//隐藏左上角行情信息
'paneProperties.legendProperties.showLegend': false,
'left_toolbar': false,
//销量面板尺寸,支持的值: large, medium, small, tiny
"volumePaneSize": "medium",
// 设置十字线
'paneProperties.crossHairProperties.color': "rgba(197, 206, 226, 0.4)",
//#ifdef APP-PLUS
'paneProperties.crossHairProperties.width': 5,
//#endif
//#ifdef H5
'paneProperties.crossHairProperties.width': 1,
//#endif
'paneProperties.crossHairProperties.style': 0,
//烛心
// "mainSeriesProperties.candleStyle.drawWick" : true,
//烛心颜色
//"mainSeriesProperties.candleStyle.wickUpColor:" : '#8a3a3b',
//"mainSeriesProperties.candleStyle.wickDownColor" : "#8a3a3b",
// 白色烛心颜色
// "mainSeriesProperties.candleStyle.wickUpColor:" : '#8a3a3b',
// "mainSeriesProperties.candleStyle.wickDownColor" : "#8a3a3b",
//边框
"mainSeriesProperties.candleStyle.drawBorder": true,
},
}
exports.chartConfig = chartConfig