iOS Core Plot X Axis text + icon - ios

Hope you people doing great.I am new to Core Plot api and need your suggestion.I want to customize x index of plot and wants to add icon and label to each index.As I have searched , I got to make policy none to index but I want to add image to each label.Help will be much appreciated.

Custom axis labels don't have to be just text. The label's contentLayer can be any CPTLayer. Depending on what you're trying to achieve, you could render your text and label into an image and use that as the fill for a CPTBorderedLayer, add the icon (in a bordered layer) as a sublayer to the text layer for the label, or even create a custom CPTLayer subclass that draws everything the way you want it.

Related

line chart with values and dates graph iOS

I have previously used core plot and jawbone line chart view but now I want grid (background) on graph.
I wanna make exactly like above image any help would be appreciated and also please be specific while posting some third party libs and all.
How can I achieve the above graph (if selected dot/value to show callout) with callout?
Note- In X- axis (dates) and Y- axis (values) are there.
Edit 1:
Is it possible to achieve in core plot? If Yes, How and please be specific.
Thanks in advance.
You can use a plot space annotation to label the callouts. A simple rounded rectangle shape for the labels is easy—set the fill, borderLineStyle, and cornerRadius of the Core Plot text layer used for the annotation. If you need the little arrow on the side of the annotation, you should be able to draw that by using a stretchable image for the fill.

iOS Core Plot: Multiple labels for x-axis

Not sure if the is achievable using the Core Plot framework, wondering if anyone has an idea on this? What I want is to have a bar chart with the X-axis having different labels to give additional info as the image below!
Core Plot can display attributed strings in titles and labels. Create custom axis labels and set the attributedText on the label text layer.

How to create popup and intersecting line passing through center of plot symbol in core plot?

How can i create popup and intersecting line passing through center of plot symbol in core plot similar to LineChartView Link:
Screen Shot. Thanks
The Mac CPTTestApp example app includes a "Selection Demo" that draws a cross through the selected point. It is trivial to modify that code to draw only the vertical line. Many of the example apps display a label over the selected point. It's easy to add a border and fill to the text layer that displays the selected value.

Custom UiTableView from array data

I have a custom table view and want it to look like this...
(source: pulsewraps.co.uk)
The image is loaded via async and the two lines come from two different arrays. I can get all the data in fine I just don't know how to lay it out.
I want:
the black gradient to overlay the image
the two lines of text to be within the black gradient box
the image to fill the table row to cover it and keep it's aspect ratio
the black gradient box to be pinned/constrained to the bottom of the image so that is either line of text is larger than two lines it covers more of the image and doesn't drop below it.
I fill the table data in a loop according to the number of records in my array which is populated by json.
I have managed to do the layout in android but can't get my head around ios.
Any help much appreciated.
If you're using autolayout, you'll want to constrain the labels to the bottom and to each other. Then put the gradient view behind the labels and constrain the top of the gradient to the top of the top label.
You'll have to handle drawing the gradient yourself, either use an image in an image view and set it to scale to fill, or subclass UIView and add a little bit of code to drawRect: The first is probably easier, the second will produce a more uniform gradient if it has to be scaled.

Adding title to the PlotSymbol

Is it possible to set a title instead of A CPTPlotSymbol ? I want to display the co-ordinates instead of a symbol.Here is the screen shot.I want a label where , there is a circle symbol plot in the screen shot.
Set the plotSymbol to nil to remove the symbols from the plot. You want to use data labels to label the points. If you just want to show the y-coordinate, set a labelTextStyle and labelFormatter. The plot will create and display labels automatically using the given style and number format.
If you need more complex labels (e.g., showing both x and y coordinates), you can make custom labels. Implement the -dataLabelForPlot:recordIndex: datasource method. This method can return any CPTLayer, so you have a lot of flexibility. For simple text labels, create a string with the label text and display it in a CPTTextLayer. The plot will position the label for you and keep it aligned with the data point if it moves.

Resources