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

Extend beyond values (feature request) #1025

Closed
128keaton opened this issue May 12, 2016 · 14 comments
Closed

Extend beyond values (feature request) #1025

128keaton opened this issue May 12, 2016 · 14 comments

Comments

@128keaton
Copy link

128keaton commented May 12, 2016

simulator screen shot may 12 2016 6 43 40 pm
Is there anyway I can extend like above?

newui-test strip

@liuxuan30
Copy link
Member

the first question would be, what's your chart view's frame and contentRect.
You can disable yAxis.drawLabelsEnabled and try. Normally lien chart will stretch to the full width of contentRect, which is inside the chart view's frame.

@aastein
Copy link

aastein commented May 13, 2016

Why not parameterize the equation, then add endpoints to your data set generated from the parameterized equation?

@128keaton
Copy link
Author

128keaton commented May 13, 2016

@aastein I'm not sure if it is data related, but I highly doubt that. If it ends up being a data issue, I'll take that into consideration

@liuxuan30 it appears that the frame is full size:
screen shot 2016-05-12 at 10 17 17 pm

@aastein
Copy link

aastein commented May 13, 2016

Are lines supposed to extend past the defined data points per the existing functionality? I don't have any problem extending lines to the edges of my views if I have data points defined at the edges. Is it that your x-axis limits extend to the edge of the view, but your data points lie within those limits?

If this is the case:
---------------------120=============================102---------------------
ViewEdge--------------------------------------------------------------------------ViewEdge
(xMin)------0-------1-----2------3------4------5------6------7------8-------9------(xMax)

Why not do:
dummyPoint=====120============================102=====dummyPoint
ViewEdge--------------------------------------------------------------------------ViewEdge
(xMin)------0-------1-----2------3------4------5------6------7------8-------9------(xMax)

@128keaton
Copy link
Author

@aastein hmm, I guess you are right. Maybe this should be a feature request. It would look a ton better if the fill and line extended beyond the point.

I took your suggestion, but the following makes the points disappear:
self.insulinChart?.setVisibleXRange(minXRange: 0, maxXRange: self.view.frame.width)

@aastein
Copy link

aastein commented May 13, 2016

I believe you are using maxXRange incorrectly:

"Limits the maximum and minimum value count that can be visible by pinching and zooming. e.g. minRange=10, maxRange=100 no less than 10 values and no more that 100 values can be viewed at once without scrolling"

So youre setting the maximum amount of values that can be displayed equal to the view frame width. Pretty sure that's not right.

@128keaton
Copy link
Author

@aastein ah, I assumed, since it was a float value, it was not a count, but a scaling size.

@128keaton 128keaton changed the title Extend beyond values? Extend beyond values (feature request) May 13, 2016
@128keaton
Copy link
Author

I see that there is a layer fill option? Could I use this? (I couldn't figure out how)

@liuxuan30
Copy link
Member

liuxuan30 commented May 16, 2016

I don't see what feature is requested?
To me it seems like the minOffset is not 0. You can try. There is minOffset, extraLeftOffset, etc.

            offsetTop += self.extraTopOffset
            offsetRight += self.extraRightOffset
            offsetBottom += self.extraBottomOffset
            offsetLeft += self.extraLeftOffset

            _viewPortHandler.restrainViewPort(
                offsetLeft: max(self.minOffset, offsetLeft),
                offsetTop: max(self.minOffset, offsetTop),
                offsetRight: max(self.minOffset, offsetRight),
                offsetBottom: max(self.minOffset, offsetBottom))

@128keaton
Copy link
Author

@liuxuan30 I've pretty much given up on this, and have taken the UI in a nicer direction. Thanks for this, maybe it will help someone else.

@liuxuan30
Copy link
Member

you only need time and the debug skills, the library is too much to understand in a short time. Take your time!

@128keaton
Copy link
Author

@liuxuan30 I've rebuilt the UI to reflect something different. Not tinkering around with this library. Consumed my thoughts and time.

@danielgindi
Copy link
Collaborator

Actually any charting library is an overkill for your UI. If I had to implement what you've shown us in the screenshot, I wouldn't have bothered even looking for a charting library.
Just about 10 lines to draw these arrows and dashed line, and a few more for the gradiented bars.

@128keaton
Copy link
Author

@danielgindi don't make assumptions off of little information. This is a diabetes logging application, having graphs to show blood glucose and insulin doses are very informative.

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

4 participants