Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I am getting trouble with showing image on line chart at certain point on chart & also i wanted to implement curved line chart with customizable color, width & type (shown in dotted line in image) & labels at x axis & y axis.
I wanted to know is there any iOS libraries are available which provides this kind of implementation.
I know this is a duplicate question cause there are lot of questions are asked about charts for iOS but all I wanted to know is there is any library available there that can fulfill above requirement & save me lot of time for that implementation.
so far I got following libraries by doing search over google.
JBChartView
BEMSimpleLineGraph
PNchart
all off above provides line chart implementation but not curved line chart also have no provision for showing image on chart at specified point.
I am very new to chart in iOS so any help would be very much appreciated.
Thanks in advance.
Following lines can add image at given points(100,200), which will serve your purpose for drawing image.
I have developed a sample chart Library in which you will get what you need, kindly go through it. Download Library here
UIImage *image = [UIImage imageNamed:#"smiley.png"];
[image drawAtPoint:CGPointMake(100,200)];
I recommend SwiftCharts for this, it's specially designed for this kind of situations. You can add multiple layers on top of each other and generate custom views (UIView subclasses, which can be an image view or anything else) in any of these layers.
In this case you would add a layer with the curve and another layer on top of it with your custom overlays.
To produce the custom overlays you receive the complete state of each chart point, so for example you can decide if you display the image or not, or customize the image according to the chartpoint's data. See this example:
There the warning (called notifications in the example) overlays are shown only when the y value is less than 1.
There's also an example with curved line
You could use the curved line example as basis and copy-paste the notifications layer from notifications example to it and add to the chart's layers. Then customize accordingly.
(Disclosure: I'm the author)
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
Improve this question
I'm trying to create a mask out of a custom shape. I tried it with image masking and the result is given below. While my desire result is not exactly.
Using this Mask Image
The visual effect that I want to have:
Can anyone provide some hints on how can I achieve my desire effect.
What you have achieved via masking is working correctly. Masking works on alpha channel, transparent area vs visible area and images you posted in your question show exactly that.
Masking won't be enough for the effect you want to achieve. You need to experiment with CIFilter api.
Check out cifilter.io that shows a few examples of how these are supposed to look like. You might want to check out the source code for the same.
If you run this iOS project in Xcode, it provides a very easy way to browse and choose which effect is the closest to what you want to achieve.
Good luck!
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm stuck on a problem and needed some help or guide for a possible solution.
Basically in my application there will be a map with several zones.
The user can select any of these areas, at that time this area is filled with a color.
Imagine a map like this one, so i need to be able to change the color of only one country.
Something like what happens in the books of paintings (https://itunes.apple.com/pt/app/colorfly-best-coloring-book/id1020187921?mt=8), or Paint Bucket command in the Photoshop .
Any idea how to get something like this on iOS ?
Thanks in advance
The paint bucket technique you're looking for is a set of graphics algorithms usually called "flood fill". There are different approaches to the implementation depending on the circumstances and performance needs. (There is more at that wikipedia link.)
I have no experience with it, but here is a library from GitHub that purports to implement this for iOS given a UIImage object: https://github.com/Chintan-Dave/UIImageScanlineFloodfill
Re: your question about doing this without user touch: yes, you'll want to keep a map of countries to (x,y) points so you can re-flood countries when required. That said, the intricacies of the county borders might make an algorithmic fill inexact without more careful normalization of the original source. If your overall map only contains a small set of possible states, there are other ways of achieving this goal, like keeping a complete set of possible images (created in ie Photoshop) and switching them out, or keeping a set of per-country "overlay" images that you swap in as needed. (But if the flood fill is accurate on that source image, and performant for your needs, then great.)
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm creating a message app in Swift to grasp the foundations of iOS app building and am trying to style the table view cells to look like this.
I've been following tutorials but I can't seem to piece it together. It's got to be pretty simple. Does anyone have a good tutorial that does this in Swift?
I don't have a tutorial but I can give you some suggestions.
An easy way to handle this is to create a stretchable image and install it as the background image for your cells.
A stretchable image has fixed corners/edges, and the system flood-fills the center with a solid color. You take an image like your speech bubble and pare it down to the smallest possible image (with a 1 point center) and then use the UIImage method resizableImageWithCapInsets: to turn it into a stretchable image.
You'd then install that stretchable image as the background image for your table view cells. If this is a chat app you might want several variants: one with the speaker's arrow pointing left, one with the speaker's arrow pointing right, and perhaps different colors.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I'm going to create an iPad application to show and modify bar charts (where every bar is composed by a stack of little rectangles), so I'm evaluating chart frameworks Swift-compatible.
I started to evaluate CorePlot framework and it is a good candidate, supposing to import it in Xcode following this guide.
Although I already took a look to the available tutorials, I couldn't find anything for the following scenario:
draw a chart showing 24 bars representing data coming from a JSON string, obtained from a service call
vertically pan the top of a bar, so that such bar grows or decreases accordingly
send to the service the new MODIFIED data associated to the chart
Can anyone notify here a link to tutorials/guides for such a case, please?
Thanks
Core Plot doesn't care where the data comes from. It's up to the datasource to translate it to numeric values before passing them to the plot. JSON parsing is outside the scope of a plotting library like Core Plot.
I'm not sure what you're asking in #2. It's easy to update the plot with new data and resize the visible parts of the plot area to display it, but that's the responsibility of the controller object and the datasource.
Core Plot is for display only. Any interaction with external services is the responsibility of the controller object.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am using Inkscape and I know how to use transparency within the image, but I am annoyed that the background of the workspace in Inkscape is white. I searched through a lot of settings, but had no luck.
How do I get the workspace checkered like in GIMP?
The white workspace is really bothersome if you design something in white
You can change the background color in Inkscape by changing the document properties (in the File menu).
In particular, you can check 'Checkerboard background' to show the checkerboard if the background is set to transparent.
A quite ugly solution is to design your own checker background and have it as locked bottom layer :) Im doing something similar when im fiddling around with iOS icons or items that will be on a background.
Also as Juve mention you could try out the grids property.
First of all, a hint on transparency. If you export images with transparency for example to PDF (for printing), they are converted to bitmaps inside the PDF or produce unwanted results. Export to non-vector formats should be fine. I suggest to avoid transparency, usually there is a way to mimic transparency, e.g., by just using a light gray for shadows. Also don't use blur effects; similar problems with PDF export.
Now to the checkboard:
It's not possible, one workaround would be to add full page sized box and choose black checker board as fill. Put this box on a separate layer and lock the layer. You might also lighten that box up using one of the filters. Unfortunately this board won't adapt when zooming.
Maybe not the solution, but a related option would be the grid (press #). This is not behind your drawing but in front. It can help you with positioning. Maybe you were looking for this?