Hello, has anyone found any solution with regards to using BigInt in SciChartJS. I am building an app that renders time series chart of say last 2 hours of market data activity of a given instrument (ESH3, a CME futures instrument).
The backend sends the data as JSON object in fragments (1000 fragments with 1000 items in an array fragment, so the total data for 2 hours is 1000 x 1000 = 1,000,000 items in an array).
Each item in the array has a time field (for x-axis) and say TradePrice (for y-axis). The time field is a unix time and it just cannot fit into the number field. So we parse it using BigInt as follows:
JSON.parse(rawData, (key, value) => {
if (key.includes('time')) return BigInt(value);
return value;
});
The parsing works, but, now SciChartJS is not happy about that. It needs number to append the data into its XyDataSeries object.
Has anyone come across this situation before and how have you solved this?
I am thinking the following and would appreciate if someone would give their 2nd opinion as well:
1. Convert to BigInt during deserializing
2. Create a global offset value — eg. Offset = nanoseconds since mid-night of 2020
3. Use Value – Offset as x value when appending to XyDataSeries
4. When a data-point is selected in chart, use SelectedTime + Offset for get to the original value from backend
Question for ScichartJS Support:
– Any provision to support BigInt in SciChartJS in near future? This would definitely help those in financial sector with requirements like I metioned above.
- sachin patel asked 2 months ago
- last active 2 months ago
Hello there
I’m looking for any solution to work with milliseconds timestamps (like that one 1563448997279), but haven’t found anything yet.
Is it possible to handle them without losing precision?
Solutions like drop milliseconds not working for me.
One more question to developers:
What is the difference in SCIDataType_DateTime and SCIDataType_SwiftDateTime?
In source code i only found this:
@field SCIDataType_DateTime – NSDate
- Kirey Vadim asked 4 years ago
- last active 4 years ago