How to customise the zooming of Line Chart - ios

I have a problem. I am using the newest version of Xcode, Swift 5.1 and Charts danielgindi pod. I turned on the zooming of the LineChart and I want to customise this zooming. Here is a picture of the chart https://imgur.com/a/3Cpi89v . I want the zooming to be only on the edges of the chart, not everywhere. What I mean, If the user zoom in the spot that is close to the bottom part, only to zoom into the edges of the line, like this: https://imgur.com/a/W50yMXP, only for the red areas. The same should be for the top part. Is there any way to do this.

Related

Issue with MKOverlayView

We are working on MKOverlayView, below is the expected functionality:
An image has to be overlaid on the map and has to be tilted by a certain angle (bearing).
Issue: When the map is zoomed to the maximum level, one of the corners of the overlaid image is getting truncated. But, Complete image is coming back when zoom out a little bit.
Please find the attached screenshot for reference.
I'm also getting overlaying text being clipped at any zoom level. What I noticed is that it clips at some vertical invisible lines. Those invisible lines, they look like as if they were the actual map tiles.
What it still works is other overlays I have on the map, they don't get chopped.
This started to happen with iOS 10.
In the image, the building outlines –colored- are overlays that don't get clipped, but the text overlays (drawn using drawInRect) they do get chopped. Texts are Very Long text1 to see if it truncates, changing text1 for text2 and so forth.

Core Plot library to draw graph in auto layout Xcode 6.1 for any device orientation, legends in iOS

I want to draw graph in iOS native app (Making app using auto layout and Xcode 6.1)..after googling I found core plot lib for drawing graph.
I am struggling with this library to do make pie,bar,donut and line chart as I want.
I used the examples which are in 'examples' folder of this library.
How do I make graph to adjust when app is rotating and takes auto
layout constraints?
For bar/line chart-I don't get idea to make graph compact or make
scroll when there is large data to show on x or y axis?
For any chart- How do I show legends(title or explanation for
graph)?
How do I show values on bar/pie/line itself(Value on each
pie slice / every bar/ every line point)?
Can I set X and Y axis start and end point?
Please help if anybody have an idea? Thanks in advance.
The Plot Gallery example app demonstrates all of these things. You'll need to use the latest code from GitHub (release 1.5.1 doesn't have some of the newer features like auto layout; 1.6 will be out soon, but isn't quite ready yet).
The iOS version of the Plot Gallery uses a storyboard and auto layout to control the UI.
Set allowsUserInteraction to YES on the plot space to enable pinch zoom and scrolling behavior. You can disable pinch gestures and keep the scrolling behavior with the allowPinchScaling property on the hosting view.
Many of the Plot Gallery demos have legends. Look for CPTLegend in the code. Ask a more specific question if you need more help with this.
These are known as "data labels" in Core Plot. Many of the Plot Gallery demos have them. You can set a formatter and text style on the plot to turn them on, or use a plot delegate to have more control over each label.
Set the xRange and/or yRange of the plot space associated with the axes to control the coordinate space of the plot area.

Drag and Drop plots and other available features of Core-Plot?

i am new to core-plot frame work, i have few doubts about the feature of this frame work. May be my question very simple or unwanted, but still i am posting here for my clarification.
Its possible to drag and drop plot in core-plot framework.
Can i achieve smooth scrolling (like: UIScrollView) in core-plot?
If my graph size is beyond screen size means, how i can handle to scroll the graph to see fully?
If Its possible means kindly guide me to which Class or API provide this features, or any other things i have to follow. Thank you in advance....
Short answer, yes.
Set the allowsUserInteraction to YES for each plot space you want to respond to touch scrolling and pinch zoom events. Set allowPinchScaling to NO on the hosting view to keep the scrolling behavior and disable pinch gestures.
The xRange and yRange of the plot space determine the visible are of the plot area. Any plot data outside these ranges will be clipped and invisible. The plot ranges can be changed by the user (via scrolling and/or zooming) or directly in code by the app.
Be sure to look at the example apps included with Core Plot. Many of them include scrolling graphs.

IOS Image Rotational Scrolling

I have chart images that are conical projections. Whenever the chart position moves, I need to rotate the chart. Imagine viewing a globe from above. The change in rotation is generally less than 1 degrees for a full screen of scrolling.
I am currently doing this in an image view within a scroll view, redrawing the images when the position changes. Any small change in position requires a complete redraw.
Is there a way to have IOS rotate the images within the layer without having to redraw them.
I am imaging something like in the maps app where you can scroll-rotate your course.
Another way of looking at it would be to have something like a scroll view that can scroll up/down or rotate its contents around an axis that may be way off the top of the screen.

Core-Plot CPTRangePlot filled area is distorted when scrolling (iOS)

Recently I have encountered a strange behavior from CPTRangePlot (I'm using Core-Plot 1.3).
I have a set of 365 data to display on the screen using CPTRangePlot. It works fine if all 365 points are displayed on the screen.
However, if I zoom in by using plotSpace:willChangePlotRangeTo:forCoordinate method to a certain level, the fill area will be distorted and the plot will be filled incorrectly. If I scroll to another plot range, the distorted area becomes fine and but another distorted area appears.
Everything goes back to normal if I zoom out.
Here are the images for your reference:
Before Zoom in:
After Zoom in:
Any idea what happening here? All other plot types (Scatter, Trading, Bar) work fine when I zoom in/out or scroll :-(
P/S: I tried the latest version of Core-Plot (1.4+) but no success.
This looks like a Core Plot bug—it is skipping points that fall outside the visible area when drawing the fill. Please report this on the Core Plot issue tracker.

Resources