iOS developer since 2013, currently working on my sleep app in my spare time.
I sometimes write at johnyorke.me and you can also find me on Twitter.
Having a good time...all the time.
Simple line graph view for iOS.
License: MIT License
iOS developer since 2013, currently working on my sleep app in my spare time.
I sometimes write at johnyorke.me and you can also find me on Twitter.
Having a good time...all the time.
I'm trying to use the graphing on the watch but when I copy the four files you mention I'll need it runs into compile error saying that it can't find UIView. From what I read UIView is not available on the WatchKit. I'm trying to compare with your demo app but can't see where/how I can make the changes so that JYGraphView and JYGraphPoint files don't give me errors. Your help is much appreciated.
Great work. I have been reading the code and quite interested in
drawCurvedLineBetweenPoints
What is the theory behind the following code? I understand it is drawing curving lines. But I am wondering why the following code draws smooth curving lines. Maths! ;)
for (int index = 1; index < points.count - 2 ; index++) {
CGPoint point0 = [self pointAtIndex:index - 1 ofArray:points];
CGPoint point1 = [self pointAtIndex:index ofArray:points];
CGPoint point2 = [self pointAtIndex:index + 1 ofArray:points];
CGPoint point3 = [self pointAtIndex:index + 2 ofArray:points];
for (int i = 1; i < granularity ; i++) {
float t = (float) i * (1.0f / (float) granularity);
float tt = t * t;
float ttt = tt * t;
CGPoint pi;
pi.x = 0.5 * (2*point1.x+(point2.x-point0.x)*t +
(2*point0.x-5*point1.x+4*point2.x-point3.x)*tt +
(3*point1.x-point0.x-3*point2.x+point3.x)*ttt)
;
pi.y = 0.5 * (2*point1.y+(point2.y-point0.y)*t +
(2*point0.y-5*point1.y+4*point2.y-point3.y)*tt +
(3*point1.y-point0.y-3*point2.y+point3.y)*ttt);
if (pi.y > self.graphView.frame.size.height) {
pi.y = self.graphView.frame.size.height;
}
else if (pi.y < 0){
pi.y = 0;
}
if (pi.x > point0.x) {
[path addLineToPoint:pi];
}
}
[path addLineToPoint:point2];
}
Is it possible to add overlaying more than one dataset? Say, temperature and humidity on the same graph?
Thx.
Hi. I was wondering if this is set up to handle dynamically adding data. I would like to add real time capabilities to it and wanted to check first if that's something included
Thanks!
I have noticed that if you call plotGraphData more than one time, the view maintains the previous drawing plus the new one.
How can avoid this?
I would like use this for a real time graph.
Thank you!
I am a new user of Xcode. I don't know how to change the width between points.
please tell me. thank you.
Hey guys! I have to first say, this is a GREAT and easy-to-use custom class. A job well done!
One issue I had with it though. When programmatically defining a JYGraphView, and throwing it into a ViewDidLoad, I didn't want to reallocate my instance every time to remove the previously drawn lines with the updated Graph Data. So I created this method inside of JYGraphView. I was going to make a pull request, but I found out this was a private repo. So, here's the code. Figured anyone else that ran into the same problem could use it too:
// Used to clear previously drawn sublayers, or lines, and replots graph
// Be sure to update your JYGraphView's graphData and graphDataLabels before calling this
Feel free to add this to your repo for JYGraphView!
It would be great if this library was published as a Cocoapod.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.