-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1060 from olegchernenko/master
Add the ability to set width of the border of the crosshair marker #1059
- Loading branch information
Showing
6 changed files
with
77 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
tests/e2e/graphics/test-cases/series/crosshair-marker-border-width.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
function generateData(step) { | ||
const res = []; | ||
const time = new Date(Date.UTC(2018, 0, 1, 0, 0, 0, 0)); | ||
let value = step > 0 ? 0 : 500; | ||
for (let i = 0; i < 500; ++i) { | ||
res.push({ | ||
time: time.getTime() / 1000, | ||
value: value, | ||
}); | ||
|
||
value += step; | ||
|
||
time.setUTCDate(time.getUTCDate() + 1); | ||
} | ||
return res; | ||
} | ||
|
||
function runTestCase(container) { | ||
const chart = window.chart = LightweightCharts.createChart(container); | ||
|
||
const areaSeries = chart.addAreaSeries({ | ||
crosshairMarkerBorderWidth: 5, | ||
crosshairMarkerBorderColor: 'yellow', | ||
crosshairMarkerBackgroundColor: 'red', | ||
}); | ||
|
||
const lineSeries = chart.addLineSeries({ | ||
crosshairMarkerBorderWidth: 1, | ||
crosshairMarkerBorderColor: 'blue', | ||
crosshairMarkerBackgroundColor: 'green', | ||
}); | ||
|
||
areaSeries.setData(generateData(1)); | ||
lineSeries.setData(generateData(-1)); | ||
} |