Closed alvins7 closed 8 months ago
That offset is random, it can change if you pan X direction. Does the baseTime option solve your problems?
I tried baseTime but got nothing, maybe my usage is wrong, here is my code and data demo `<!DOCTYPE html>
Test if we have precision issue with very large X
`The data X-axis usually has 4 decimal places
set baseTime
to 9600, then substract 9600 from each x in your dataset before sending it to chart. e.g. the first x should be -0.154
The smaller the absolute value, the higher the accuracy
It works a bit, but my x-axis data volumes are usually in the millions or more
Would it be better to draw a point with WebGL
When we hit the precision limit, panning is not smooth in WebGL. So, what is the min and max X value in your data? You can also limit the zoom-in to limit the artifact. see minDomainExtent.
min:9000 max:90000 step: about 0.02 I've already tried minDomainExtent but he doesn't fit my scenario, I'll try another solution.
Please try #75 , and provide your feedback, thanks.
Thanks, it seems to be working But,My time step is 0.032, if I set xStep to 0.032, it's around 80% correct, if I set xStep to 0.1, it's 95% correct,and if I don`t set xStep, it's 80% correct.
That's strange. I expect no visible precision loss with this patch. Can you post the code you use for testing?
OK,I'll post the code tomorrow.
My test code and test data is here . code: demo/large_data_range_xstep0.1.html and demo/large_data_range_xstep0.032.html. data: demo/data.js. And When I tested it, the error usually occurs around x=14985 and zoom-in to minDomain. the error rate is higher when the x value is larger.
OK, I've checked your data. There are 2 issue:
xStep
should be 0.0032diff --git a/demo/large_data_range_xstep0.032.html b/demo/large_data_range_xstep0.032.html
index 8ffccab..5db7f43 100644
--- a/demo/large_data_range_xstep0.032.html
+++ b/demo/large_data_range_xstep0.032.html
@@ -26,12 +26,22 @@
<script src="./data.js"></script>
<script>
const el = document.getElementById('chart');
+ let curSeries = null;
+ const series = [];
+ let lastX = -Infinity;
+ for (const d of data) {
+ if (d.x - lastX > 10) {
+ if (curSeries) {
+ series.push(curSeries);
+ }
+ curSeries = { name: `Run ${series.length}`, data: [], xStep: 0.0032 };
+ }
+ curSeries.data.push(d);
+ lastX = d.x;
+ }
const chart = new TimeChart(el, {
baseTime: 9599,
- series: [
- // { name: 'Line 1', data: data1, color: 'blue' },
- { name: 'Line 1', data: data, color: 'blue', xStep: 0.032, xStepCorrection: true },
- ],
+ series,
zoom: { x: { autoRange: true, minDomainExtent: 0.1, } },
tooltip: {
enabled: true,
About xstep, It`s my fault, I'll make sure to set it to 0.0032. Now.
About multiple series, I can use it, but I've noticed that if I do, my tooltip will display values for multiple series and highlight multiple points. I'm not sure if there's a way to handle this later based on some property like type, or if I should try to solve it myself. I can use multiple series, but I need the tooltip to behave the same way as with single series.(PS: Maybe we should also consider not affecting the functionality of genuine multiple series)
Hi, I've fixed the tooltip to hide the out-of-range series instead of showing the stall highlight state. I also fixed an issue of inaccurate zoom origin calculation. You may try that by merging the latest master and predict-x branches.
Thanks, I`ve try the latest master and found some issues. Perhaps the problem isn`t hide the out-of-range series, but in needing tooltip and legend for only one series when the main series is split into multiple series.
There are two pic, the first one is the current one and the second one is what I need. 1.
2.
And I've simply addressed the tooltip and legend at My branch(PS. It’s already been merged from both the master and predict-x branches.) , but I'm not sure if there are any other plugins with the same issue.
When I use tooltip the generated points are offset compared to the folded points, I read the question in #60 and understand that it's a GPU precision issue, I'd like to ask if it's possible to offset the points generated by the tooltip as well