tradingview / lightweight-charts

Performant financial charts built with HTML5 canvas
https://www.tradingview.com/lightweight-charts/
Apache License 2.0
9.4k stars 1.62k forks source link

[bug] Price line didn`t hightlight price #273

Closed odlainepre closed 4 years ago

odlainepre commented 4 years ago

Lightweight Charts Version: 1.2.1

https://jsfiddle.net/ovpk2w07/1/

Untitled

karunkrishna commented 4 years ago

Possible to also add a custom alert string? image

const priceLine = emaSeries.createPriceLine({
    price: 2700,
    color: 'green',
    lineWidth: 1,
    lineStyle: LineStyle.Solid,
    priceVisible: true,
    alertString: 'Entry'

});
odlainepre commented 4 years ago

@karunkrishna hi. For what? make a separate function and set default parameters, name it createAlertLine

karunkrishna commented 4 years ago

When creating a createPriceLine, there should be a flag "priceVisible" that allows users to enable/disable the highlighted price (like your issue implies). Likewise, it would be a nice enhancement to be able to give a string label for the PriceLine. In the example above, the price line has a right-justified string "Entry"

odlainepre commented 4 years ago

string label for the PriceLine

@nikitamarcius please note that the first version will not support drawing text for price lines (on, above or even below).

https://github.com/tradingview/lightweight-charts/issues/183#issuecomment-557514399

enable/disable the highlighted price

I don’t see the point, I think that the price should always be highlighted. You either add a line or not

timocov commented 4 years ago

Likewise, it would be a nice enhancement to be able to give a string label for the PriceLine. In the example above, the price line has a right-justified string "Entry"

@karunkrishna please fill another issue for that.