-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Changed rendering of baseline and area series when using scaleMargins #1010
base: master
Are you sure you want to change the base?
Changes from all commits
5089537
8085baf
5ab39be
560af29
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,6 @@ debug.html | |
|
||
# graphics tests out data | ||
/tests/e2e/graphics/.gendata/ | ||
|
||
# MacOS | ||
.DS_Store | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,12 +31,23 @@ export class SeriesBaselinePaneView extends LinePaneViewBase<'Baseline', LineIte | |
} | ||
|
||
const baselineProps = this._series.options(); | ||
const priceScale = this._series.priceScale(); | ||
const priceScaleProps = priceScale.options(); | ||
const isCustomScale = priceScale.id() !== 'right' && priceScale.id() !== 'left'; | ||
|
||
this._makeValid(); | ||
|
||
const baseLevelCoordinate = this._series.priceScale().priceToCoordinate(baselineProps.baseValue.price, firstValue.value); | ||
const baseLevelCoordinate = priceScale.priceToCoordinate(baselineProps.baseValue.price, firstValue.value); | ||
const barWidth = this._model.timeScale().barSpacing(); | ||
|
||
let top = 0; | ||
let bottom = height; | ||
|
||
if (baselineProps.baseValue.type === 'price' && isCustomScale && priceScaleProps.scaleMargins) { | ||
bottom = height * (1 - priceScaleProps.scaleMargins.bottom); | ||
top = height * priceScaleProps.scaleMargins.top; | ||
Comment on lines
+47
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. well, I don't think that it should be like that. Instead, we need to get min/max coordinates for a visible range of this series. If we'll do this we won't need to check whether it is a "custom" scale or not because it will work automatically for any series. See my comment here #1005 (comment) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also, you could take a look at |
||
} | ||
|
||
this._baselineAreaRenderer.setData({ | ||
items: this._items, | ||
|
||
|
@@ -50,7 +61,8 @@ export class SeriesBaselinePaneView extends LinePaneViewBase<'Baseline', LineIte | |
lineType: baselineProps.lineType, | ||
|
||
baseLevelCoordinate, | ||
bottom: height as Coordinate, | ||
top: top as Coordinate, | ||
bottom: bottom as Coordinate, | ||
|
||
visibleRange: this._itemsVisibleRange, | ||
barWidth, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't mind let's revert this. This folder should in your global gitignore since it has no in common with the project itself.