@react-financial-charts/series
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -6,2 +6,17 @@ # Change Log | ||
## [1.3.2](https://github.com/reactivemarkets/react-financial-charts/compare/v1.3.1...v1.3.2) (2021-10-17) | ||
### Bug Fixes | ||
* **series:** fixing bug in CandlestickSeries ([b7201f8](https://github.com/reactivemarkets/react-financial-charts/commit/b7201f882b36671400bae6ab79d6ef3ef65b9b69)), closes [#594](https://github.com/reactivemarkets/react-financial-charts/issues/594) | ||
* do not round offset anymore ([2dc53ee](https://github.com/reactivemarkets/react-financial-charts/commit/2dc53ee59056a617dd9c95b114c36ed7f0d89ab1)) | ||
* remove rounding of x-axis location ([5cf2c13](https://github.com/reactivemarkets/react-financial-charts/commit/5cf2c1389c5d7364d6241f3c83b0a37ba445cf5f)) | ||
* remove rounding of x-axis location ([64e893f](https://github.com/reactivemarkets/react-financial-charts/commit/64e893fb3a2d1c2b3f430b90572784f5c8fe02fa)) | ||
* stop rounding offset ([7944b2d](https://github.com/reactivemarkets/react-financial-charts/commit/7944b2d4dd66ccfda459011f33ba08c01db1b561)) | ||
## [1.3.1](https://github.com/reactivemarkets/react-financial-charts/compare/v1.3.0...v1.3.1) (2021-06-16) | ||
@@ -8,0 +23,0 @@ |
@@ -52,3 +52,3 @@ import { functor, head, getAxisCanvas, GenericChartComponent, plotDataLengthBarWidth, } from "@react-financial-charts/core"; | ||
}); | ||
const offset = Math.floor(0.5 * barWidth); | ||
const offset = 0.5 * barWidth; | ||
return plotData | ||
@@ -61,3 +61,3 @@ .map((d) => { | ||
const xValue = xAccessor(d); | ||
const x = Math.round(xScale(xValue)) - offset; | ||
const x = xScale(xValue) - offset; | ||
let y = yScale(yValue); | ||
@@ -64,0 +64,0 @@ let h = getBase(xScale, yScale, d) - yScale(yValue); |
@@ -61,6 +61,11 @@ import { functor, getAxisCanvas, GenericChartComponent, plotDataLengthBarWidth } from "@react-financial-charts/core"; | ||
}); | ||
const trueOffset = 0.5 * width; | ||
const offset = trueOffset > 0.7 ? Math.round(trueOffset) : Math.floor(trueOffset); | ||
const offset = 0.5 * width; | ||
return plotData | ||
.filter((d) => d.close !== undefined) | ||
.filter((d) => { | ||
const ohlc = yAccessor(d); | ||
if (ohlc === undefined) { | ||
return false; | ||
} | ||
return true; | ||
}) | ||
.map((d) => { | ||
@@ -72,3 +77,3 @@ const ohlc = yAccessor(d); | ||
const xValue = xAccessor(d); | ||
const x = Math.round(xScale(xValue)); | ||
const x = xScale(xValue); | ||
const y = Math.round(yScale(Math.max(ohlc.open, ohlc.close))); | ||
@@ -75,0 +80,0 @@ const height = Math.max(1, Math.round(Math.abs(yScale(ohlc.open) - yScale(ohlc.close)))); |
{ | ||
"name": "@react-financial-charts/series", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "Series for react-financial-charts", | ||
@@ -52,3 +52,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "403d8b776af90cbd787af7683a8d1537108b1b25" | ||
"gitHead": "5243344cf288255c0f001fa669d78ab0437dab64" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
309864
5859