Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Baseline series type #151

Closed
alekiv opened this issue Jul 26, 2019 · 8 comments · Fixed by #813
Closed

Baseline series type #151

alekiv opened this issue Jul 26, 2019 · 8 comments · Fixed by #813
Assignees
Labels
enhancement Feature requests, and general improvements. need proposal Requires a detailed proposal before more further.
Milestone

Comments

@alekiv
Copy link

alekiv commented Jul 26, 2019

Is it possible to fill Area from predefined level (ex. 0)?
If you draw graph with negative values it currently fills area up from minimum value.
It maybe will be more logical to fill are from maximum to minimum.

https://jsfiddle.net/axtm3wr0/

image

@timocov
Copy link
Contributor

timocov commented Aug 1, 2019

It looks like Baseline chart type (you can see it on www.tradingview.com/chart).

@timocov timocov added the enhancement Feature requests, and general improvements. label Aug 1, 2019
@timocov timocov changed the title AreaSeries: fill area from predefined level Baseline series type Aug 1, 2019
@alekiv
Copy link
Author

alekiv commented Aug 1, 2019

It looks like Baseline chart type (you can see it on www.tradingview.com/chart).

Yep, it is.

karanjitsingh added a commit to karanjitsingh/lightweight-charts that referenced this issue Aug 26, 2019
@timocov timocov added the need proposal Requires a detailed proposal before more further. label Sep 12, 2019
@timocov timocov added this to the 1.3.0 milestone Sep 12, 2019
@timocov timocov modified the milestones: 1.3, 1.4 Feb 6, 2020
@timocov timocov modified the milestones: 3.0, Future Mar 6, 2020
@thanhlmm
Copy link

In fact, I'm working with this with the interface in like:

basePrice: number;
underBaseTopColor: string;
underBaseBottomColor: string;
underLineColor: string;

It might not fit in future but feel free to give me suggetion

@timocov
Copy link
Contributor

timocov commented Jul 30, 2021

At the time in charting_library for baseline chart type we have the following properties, probably we can use some names/properties from them:

  • baselineColor - the color of baseline line
  • topFillColor1 - the start color of top area
  • topFillColor2 - the end color of top area
  • bottomFillColor1 - the start color of bottom area
  • bottomFillColor2 - the end color of bottom area
  • topLineColor - the color of top line (above the baseline)
  • bottomLineColor - the color of bottom line (below the baseline)
  • topLineWidth - line width of top baseline
  • bottomLineWidth - line width of bottom baseline
  • baseLevelPercentage - percentage value of baseline, it might be from 0 to 100 and it is based on the current viewport, not on absolute price value

@thanhlmm
Copy link

thanhlmm commented Jul 31, 2021

All make sense except baseLevelPercentage I think the base ine determined by price is more useful and configruable than level percentage. So my suggestion is basePrice
baselineColor => we can remove it since dev has the option to add price line manually with addPriceLine

@timocov
Copy link
Contributor

timocov commented Aug 2, 2021

All make sense except baseLevelPercentage I think the base ine determined by price is more useful and configruable than level percentage. So my suggestion is basePrice

@thanhlmm Yeah, probably we can make it configurable and do something like baseValue: { type: 'price', price: number } for now? In the future, if we'll decide to add new type of baseline value we can easily without a breaking change add it.

Also, I think it should be a different chart type with their own options (not extending the current one like line or area). Just to make it clearly and explicitly.

What do you think?

@thanhlmm
Copy link

thanhlmm commented Aug 2, 2021

Agree on both of your ideas

@timocov timocov modified the milestones: Future, 3.7 Sep 8, 2021
@timocov
Copy link
Contributor

timocov commented Nov 2, 2021

Fixed in #813

@timocov timocov closed this as completed Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests, and general improvements. need proposal Requires a detailed proposal before more further.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants