project-nv / night-vision

Highly customizable charting library, created for professional traders
https://nightvision.dev
MIT License
242 stars 57 forks source link

Add pricelabel to overlay #67

Closed MrBjurhager closed 1 year ago

MrBjurhager commented 1 year ago

Describe the bug

Hi, How can i add pricelabels to overlays other than the main overlay? and how do i change the pricelabel text color? Iv'e tried

 stockchart, {
     colors: {
     textcolor: rgba(255, 255, 255, 1),
     color: rgba(255, 255, 255, 1),
     text: rgba(255, 255, 255, 1),
}
}

Best / F

Reproduction

#

Steps to reproduce

No response

Javascript Framework

no-framework (vanilla-js)

Logs

No response

Validations

MrBjurhager commented 1 year ago

Figured it out, Looked at the candles.navy and noticed:

`

valueTracker(x) => {
    show: $props.showValueTracker,
    symbol: $props.scaleSymbol,
    line: true,
    value: Number($core.data[0].avgPx),
    color: 'rgba(255, 0, 0 , 1)',
}

`

This adds a pricelabel to my custom overlay. One thing that would be nice is to be able to add text to the label ex 'value | text' ex '27500 | SL'. Also still cant figure out how to change the text color. I would assume "back:" sets the background color and that color sets text color. that does not seem to be the case and i can only change the background color via the color: key.