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

[feature request] render xAxis like yAxis style Namely from discrete way to continuous way #176

Closed
liuxuan30 opened this issue Jun 25, 2015 · 7 comments

Comments

@liuxuan30
Copy link
Member

Is it possible that scatter chart view or all charts render the xAxis and the data in a 'continuous' way rather than 'discrete' way?

For example, if the xValues is [31.2,67.8,75.3,80.9,120] and the yValues is [12,16,30,80,200]

if we draw this chart, the horizontal space will be equal to each data point; but it does not reflect the true distance for the xValues.

what I want the xAxis rendering is using the same concept for yAxis, using ratio ( dataValue / (yAxis.maxValue - yAxis.minValue) * factor), so it reflect the correct position.

@danielgindi I am not sure if you had heard such requirements; but if I do need to do this by myself, is there any documentation of how the yAxis render works, like the zooming/scrolling feature? The original android wiki is not in detail.

By the way, I was curious, how you draw the sin function line chart on the home page? It looks quite smooth, with such a smooth curve, do you really generate thouds of xValues?

@liuxuan30 liuxuan30 changed the title Is it possbile to replace xAxis and its render to yAxis style? Namely from discrete way to continuous way Is it possbile to render xAxis like yAxis style? Namely from discrete way to continuous way Jun 25, 2015
@danielgindi
Copy link
Collaborator

Well I don't know about the axis - I think @PhilJay could help you here more than I could...
But about the sine function - it's pretty simple: You could play with cubic lines... or add lot's of point :-)

@liuxuan30
Copy link
Member Author

I have figure it out! I make use of the horizontal bar chart right Axis and changed the transformer setup. It works like a charm. The key point is render it like the y axis style, not by isolated index style.

@liuxuan30
Copy link
Member Author

@danielgindi and @PhilJay I do recommend you consider this, as there is actual needs for rendering xAxis like yAxis. Current xAxis limitation is it is using index to draw.

For example, when the xAxis represents date & time, I have data '10.0' at 07:05am, and have '20.0' at 07:05pm. If we use index technique, to reflect the xAxis span from 00:00 to 23:59, I have to insert many null point on each minute point, to reflect the correct ratio on x axis. Finally the for loop will be the bottleneck when drawing, if the date range is a big number

However, If we just calculate the time range, and we can calculate the ratio on x axis, we can simply only render two data, don't have to insert many null values to have the same result.

@liuxuan30 liuxuan30 changed the title Is it possbile to render xAxis like yAxis style? Namely from discrete way to continuous way [feature request] render xAxis like yAxis style Namely from discrete way to continuous way Jun 30, 2015
@liuxuan30
Copy link
Member Author

I tried to do it on my side, just take the ChartYAxisRendererHorizontalBarChart as xAxis, change the transformer CTM, and disable xAxis. However, this can lead to some conflicts such as enabling autoScaleMinMax will result in an empty chart. I am not as familiar as you genius with the transformer (CTM) stuff and some features, so it's better that you guys can do it. No offence, but I will definitely donate what I can afford to support developing this feature. How do you think?

@danielgindi
Copy link
Collaborator

This is a duplicate of #194 actually...
As long as those issues are open it means we do want to do them. It's just complicated :-)

@danielgindi
Copy link
Collaborator

Btw @liuxuan30 the transformation matrices are simple math; Implementing this feature requires something more algorithmic than just simple math. Not something complex mathmatically - just different, which means changing the transformer code to not use those matrices, and lots and lots of testing.

@PhilJay any news on your side?

@liuxuan30
Copy link
Member Author

@danielgindi Acutally I am the first one to ask this, so #194 is duplicated :-)

I just make use of the horizontal bar yAxis to do it right now.

Yes, I think it's more than transformer math while I am trying. the zooming and scrolling is killing me. I cannot find a way to correctly render the xAxis labels in the right position.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants