Compare commits

..

No commits in common. "afe010ae1d121c6c93bccd79f28dad64ee4118b9" and "1abd94cdcedf6eab1b64a48ea3ba3a69f4ada35c" have entirely different histories.

2 changed files with 10 additions and 21 deletions

View File

@ -87,13 +87,6 @@ const initEcharts = (data) => {
animation: false, animation: false,
progressive: 500, progressive: 500,
progressiveThreshold: 3000, progressiveThreshold: 3000,
// title: {
// text: 'FiEE, Inc. Stock Price History',
// },
grid: {
left: '8%', // '2%'
right: '12%', // yylabel
},
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
@ -338,15 +331,15 @@ function findClosestDateIndexDescLeft(data, targetDateStr) {
let left = 0, let left = 0,
right = data.length - 1 right = data.length - 1
const target = new Date(targetDateStr).getTime() const target = new Date(targetDateStr).getTime()
let res = -1 let res = -1 // -1
while (left <= right) { while (left <= right) {
const mid = Math.floor((left + right) / 2) const mid = Math.floor((left + right) / 2)
const midTime = new Date(data[mid].date).getTime() const midTime = new Date(data[mid].date).getTime()
if (midTime > target) { if (midTime < target) {
left = mid + 1 // mid right = mid - 1 //
} else { } else {
res = mid // mid <= target res = mid //
right = mid - 1 left = mid + 1 //
} }
} }
return res return res

View File

@ -84,10 +84,6 @@ const initEcharts = (data) => {
// title: { // title: {
// text: 'FiEE, Inc. Stock Price History', // text: 'FiEE, Inc. Stock Price History',
// }, // },
grid: {
left: '8%', // '2%'
right: '15%', // yylabel
},
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
@ -331,15 +327,15 @@ function findClosestDateIndexDescLeft(data, targetDateStr) {
let left = 0, let left = 0,
right = data.length - 1 right = data.length - 1
const target = new Date(targetDateStr).getTime() const target = new Date(targetDateStr).getTime()
let res = -1 let res = -1 // -1
while (left <= right) { while (left <= right) {
const mid = Math.floor((left + right) / 2) const mid = Math.floor((left + right) / 2)
const midTime = new Date(data[mid].date).getTime() const midTime = new Date(data[mid].date).getTime()
if (midTime > target) { if (midTime < target) {
left = mid + 1 // mid right = mid - 1 //
} else { } else {
res = mid // mid <= target res = mid //
right = mid - 1 left = mid + 1 //
} }
} }
return res return res