Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graph is not accurate with the data while spamming #163

Closed
unbounded26 opened this issue Aug 13, 2021 · 15 comments
Closed

Graph is not accurate with the data while spamming #163

unbounded26 opened this issue Aug 13, 2021 · 15 comments
Labels
bug Something isn't working

Comments

@unbounded26
Copy link

unbounded26 commented Aug 13, 2021

I'm using XCharts-2.3.0-upm.unitypackage

  1. Bug - Spamming
    The graph displayed is wrong according to passed and displayed data, if you spam on displaying the graph. While it shows perfectly fine if the showing graph button is not spammed.

I'm doing _lineChart.ClearData(); before populating graph again and _lineChart.RefreshChart(); after adding every entry in the graph
Screenshot 2021-08-13 at 4 18 42 PM
Screenshot 2021-08-13 at 4 19 26 PM
Screenshot 2021-08-13 at 4 19 47 PM
Above data remains the same, and the graph should be
Screenshot 2021-08-13 at 4 18 30 PM
While I also get the following variations of the graph by spamming the show graph button with the same above mentioned data
Screenshot 2021-08-13 at 4 27 41 PM
Screenshot 2021-08-13 at 4 28 00 PM

  1. Bug - Y-axis arrow needs to point upwards

Screenshot 2021-08-13 at 4 20 28 PM

  1. UI - Legend text should match the line color to be obvious and easy to understand
  2. UI - The selected color of the line and the point should be the same, while it is reversed. And Point color can't be set, better to be the same as the line
  3. UI - X-axis label don't stay with the x-axis on zoom, when there is a lot of data and rotation is applied
@monitor1394
Copy link
Collaborator

While I also get the following variations of the graph by spamming the show graph button with the same above mentioned data

I don't understand your question yet. What did you do when you clicked the Spamming button?

Bug - Y-axis arrow needs to point upwards

How did you set for the point downward?

UI - Legend text should match the line color to be obvious and easy to understand

You can change the theme ColorPalettle

UI - The selected color of the line and the point should be the same, while it is reversed. And Point color can't be set, better to be the same as the line

Also you can change the theme ColorPalettle. itemStyle color can set for point color, lineStyle color can set for line color.

UI - X-axis label don't stay with the x-axis on zoom, when there is a lot of data and rotation is applied

Can you show some screenshots? I don't understand the question yet.

@unbounded26
Copy link
Author

While I also get the following variations of the graph by spamming the show graph button with the same above mentioned data

I don't understand your question yet. What did you do when you clicked the Spamming button?

I mean if I press Show Graph button multiple times quickly without changing the data

Bug - Y-axis arrow needs to point upwards

How did you set for the point downward?

I don't know, as I just checked the y-axis arrow and it shows a downward arrow for y-axis, while x-axis is correct as expected

UI - Legend text should match the line color to be obvious and easy to understand

You can change the theme ColorPalettle

ColorPalette under theme don't specify which color will change the Legend text. Also

This one won't work as the above screenshots show.

UI - The selected color of the line and the point should be the same, while it is reversed. And Point color can't be set, better to be the same as the line

Also you can change the theme ColorPalettle. itemStyle color can set for point color, lineStyle color can set for line color.

Under where? as I already changed it

UI - X-axis label don't stay with the x-axis on zoom, when there is a lot of data and rotation is applied

Can you show some screenshots? I don't understand the question yet.

Here is the screenshot of graph (with same data as mentioned above) with zoom-in
Screenshot 2021-08-14 at 10 30 23 PM

Also, your source code and Plugin don't match, so which one is latest?

monitor1394 added a commit that referenced this issue Aug 15, 2021
@monitor1394
Copy link
Collaborator

monitor1394 commented Aug 15, 2021

The master branch is latest.
The release version will be released when the master is stable. So usually release version is behind the master.

UI - X-axis label don't stay with the x-axis on zoom, when there is a lot of data and rotation is applied

I've fixed it in master branch.

@unbounded26
Copy link
Author

Yes, I updated the code to master branch.

Now, Issue 1 & 2, still exists. While others are resolved.
Issue 1 is more major, as it totally changes the graph, even if tapping with some delay on ShowGraph button with same data

monitor1394 added a commit that referenced this issue Aug 16, 2021
@monitor1394
Copy link
Collaborator

Issue 1 has been fixed in the latest master branch.
But Issue 2 I don't know why yet, I can't reproduce it.

@unbounded26
Copy link
Author

Thanks a lot, yes Issue 1 is fixed. Still, Issue 2 exists, but I'm not using the arrows in my project, so you can take your time to fix it.

By the way, I haven't done anything fancy, which made the arrow downward. I just checked to see the arrow on the y-axis and it wasn't as expected (as shown in the picture)

@monitor1394 monitor1394 added the bug Something isn't working label Aug 16, 2021
@unbounded26
Copy link
Author

unbounded26 commented Aug 19, 2021

I was working on it and found another bug related to d87e0f8 (Issue 1) that if the y-data is 0, x-axis label doesn't update itself, while the data is as expected.

PROBLEM in one-line: When 0 value is set as ignore and there is at least one data greater than 0 on y-axis, then x-axis label gets updated. But if all values in y-axis are 0 then x-axis label doesn't update itself according to the data.

EXPECTED: x-axis label should update in any case according to x-axis data

This is the expected (correct) data which is in the x-axis data with 0 value on y-axis
Screenshot 2021-08-20 at 1 14 41 AM

The unchanged x-axis label
Screenshot 2021-08-20 at 1 15 02 AM

So update is still missing in some places in the code.

I tried to update your code, but couldn't fix this issue.

monitor1394 added a commit that referenced this issue Aug 20, 2021
@unbounded26
Copy link
Author

unbounded26 commented Aug 20, 2021

3949018 this one is the fix of the rotation and position fix. Now the issue is of the label, which doesn't get updated according to the x-axis data, as mentioned in the screenshots

Yeah, now I'm using the latest code, still facing the above-mentioned issue

@unbounded26
Copy link
Author

unbounded26 commented Aug 20, 2021

The following video explains the issue more clearly, as you can see the dates which I'm showing in the graph with 3 months patches

https://user-images.githubusercontent.com/7029364/130215961-432f4467-afea-4c90-abbf-142df59d739e.mov
Only the first view and the last click change the x-axis label as only data available is in that portion, while you can see I have 3 months of gap graph to show (on 3 clicks x-axis label is not changing). In middle, I have no data, so the x-axis label doesn't update, while according to x-axis data it is updated (as the screenshot previously shared shows inspector)

@monitor1394
Copy link
Collaborator

What do you do when you click the left and right buttons?Can you show me the relevant code?
By the way, you can manually refresh the axis with codes:
xAxis.SetAllDirty();

@unbounded26
Copy link
Author

unbounded26 commented Aug 21, 2021

_lineChart.xAxis0.SetAllDirty(); This also didn't work to update the x-axis label. Shared video is better to understand the issue.

// styling
_lineChart.xAxis0.axisLabel.textStyle.offset = new Vector2(0, -95f);
_lineChart.xAxis0.axisLabel.textStyle.rotate = 90f;
_lineChart.RefreshChart();

// populate data
_lineChart.AddXAxisData(dateToString("dd/MM/yy"));
_lineChart.AddData(0, GREEN_VALUE);
_lineChart.AddData(1, ORANGE_VALUE);
_lineChart.xAxis0.SetAllDirty();
_lineChart.RefreshChart();

I'm simply using the above sample code every time to show the graph with respective data of 3 months (as I know for 1 or 2 years data is too big to show on one graph). Arrows just fetch the next or previous data to populate.

Like if I'm trying to show a 1-year data on graph, then I will break it down into 4 chunks (3 months), and using arrows I will show the data. And pass only the first 3 months data to the graph to display it, then according to arrows pressed I pass the next 3 months data to show.

Kindly fix this issue, as I'm stuck in this, as with wrong data on the graph I can't submit my app

@unbounded26 unbounded26 mentioned this issue Aug 21, 2021
@monitor1394
Copy link
Collaborator

I have fixed it in 2.0 branch.
If you need to use the latest code, you'll need to switch to the 2.0 branch and download it.

@unbounded26
Copy link
Author

Yeah, thanks a lot. Issue 1 is fixed

@unbounded26
Copy link
Author

unbounded26 commented Aug 26, 2021

In branch 2.0, original issue 1 fix (d87e0f8) which was fixed in the master branch, you forgot to add in branch 2.0

Point at 10 is not visible
Screenshot 2021-08-26 at 5 17 52 PM

Also, kindly fix this issue in branch 2.0, as now I'm on 2.0

@monitor1394
Copy link
Collaborator

ok I have merged to 2.0 branch.
You can cancel serie clip.
image

monitor1394 added a commit that referenced this issue Aug 26, 2021
monitor1394 added a commit that referenced this issue Aug 31, 2021
monitor1394 added a commit that referenced this issue Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants