rafaelklaessen/react-tradingview-widget

How i can draw the horizontal line on the chart?

ArtemZubarev opened this issue · 7 comments

How i can draw the horizontal line on the chart?

Must to draw without the usage of the drawing tools from the left panel.

What exactly are you trying to do?

@rafaelklaessen I need to draw some horizontal lines (3-5) like on the screen. But i must do it programmaticly. Maybe tradingview has options for this?
2018-10-30 12 52 59

No, I don't think you can do this without the drawing tools, sadly 😞

@rafaelklaessen thank you 😉

you can do .
need use this code . and insert level in your config

const widgetConfig = {
symbol: 'AAPL',
interval: 'D',
containerId: 'tv_chart_container',
datafeed: new Datafeeds.UDFCompatibleDatafeed("https://demo_feed.tradingview.com"),
libraryPath: '/charting_library/',
chartOnly: true,
save_image: false,
width: '100%',
height: 500,
locale: "en",
disabled_features: [
"use_localstorage_for_settings",
"left_toolbar",
"header_widget_dom_node",
"control_bar",
],
enabled_features: [
"study_templates",
"dont_show_boolean_study_arguments",
"keep_left_toolbar_visible_on_small_screens",
"adaptive_logo"
],
overrides: {
"paneProperties.background": "#1C1C1E",
"paneProperties.vertGridProperties.color": "#191A1C",
"paneProperties.horzGridProperties.color": "#191A1C",
"symbolWatermarkProperties.transparency": 90,
"scalesProperties.textColor" : "#AAA",
},
paneDetails: [
{
name: "first-pane",
title: "First Pane",
gridProperties: {
color: "#191A1C",
style: 0,
visible: true
},
percent: 100,
levels: [
{
level: 50,
lineColor: "red",
lineWidth: 2,
lineStyle: 1
},
{
level: 100,
lineColor: "green",
lineWidth: 2,
lineStyle: 1
}
]
}
],
studies_overrides: {
"volume.volume.color.0": "#00B8F2",
"volume.volume.color.1": "#E80C7A",
"volume.volume.transparency": 50,
"volume.volume ma.color": "#00B8F2",
"volume.volume ma.transparency": 30
},
};

TradingView.onready(() => {
window.tvWidget = new TradingView.widget(widgetConfig);
});