core-plot

how to plot months of the year on x-axis using core plot in iphone

て烟熏妆下的殇ゞ 提交于 2019-12-13 08:06:48
问题 how to plot months of the year on x-axis using core plot and on y-axis i need multiples of 200 morever this data i used to get from an excel sheet.can anyone help me out from this. Thanks in advance.... 回答1: Here is some sample code taken from a recent project. My x-axis data was an array of NSDates. I set up my axisSet as normal, and then added the following code below: axisSet.xAxis.labelingPolicy = CPTAxisLabelingPolicyNone; NSMutableArray *countingXPoints=[[NSMutableArray alloc] init];

CorePlot: x-Axis with dates, only the first date label is showing?

倾然丶 夕夏残阳落幕 提交于 2019-12-13 07:07:55
问题 I have a Core-Plot Scatter Plot with dates on the x-Axis: NSDateComponents *dateComponents = [[NSDateComponents alloc] init]; [dateComponents setMonth:10]; [dateComponents setDay:29]; [dateComponents setYear:2009]; [dateComponents setHour:12]; [dateComponents setMinute:0]; [dateComponents setSecond:0]; NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDate *refDate = [gregorian dateFromComponents:dateComponents]; NSTimeInterval oneDay = 24 * 60 *

Charts not getting plotted on iOS 5

人走茶凉 提交于 2019-12-13 04:44:17
问题 I am using Core Plot to draw charts in my iOS application. The charts were getting plotted nicely till I was using core plot version 1.0. I just upgraded my core plot to version 1.2 and tested it on iOS 6 and all was looking OK there. But when I ran the same code on iOS 5.0 and 5.1, my bar charts got vanished and it is now showing me just a blank screen with two axes plotted. Bellow is the screenshot for the same The problem occurs only for bar graph and scatter plot whereas pie charts are

Pinch zoom limit in core plot iOS

泪湿孤枕 提交于 2019-12-13 04:41:47
问题 I have to implement pinch zoom limit in core plot. I think this is the method for pinch zoom. Could you please help what should I do in that mehtod: (BOOL)plotSpace:(CPTPlotSpace *)space shouldScaleBy:(CGFloat)interactionScale aboutPoint:(CGPoint)interactionPoint { return YES; } Could you please share some sample code. 回答1: If you a more concerned about the resulting plot range rather than the relative scaling amount (a common case), use this delegate method: -plotSpace:willChangePlotRangeTo

Core Plot 1.0: Provide Custom Labels for Legends

耗尽温柔 提交于 2019-12-13 04:00:12
问题 I am using CorePlot 1.0 and would like to add a legend to my bar chart (which is a subclassed XYGraph). I have the datasource and legend title methods in the viewController, which instantiates the bar chart and sets itself as its delegate. I have spend quite a few hours with different delegate and legend setups but can't find my error. Can you give my any hints on where I may have made an error? I have subclassed XYGraph to generate bar charts as follows: .h @interface BarLineChart :

Real Time line graph with Core Plot not updating plot range

£可爱£侵袭症+ 提交于 2019-12-13 02:24:49
问题 I just found core-plot the other day and have been trying to implement it in our current app (ARC is used) for a real-time line graph with multiple data lines. However, I can't seem to get the graph to scroll to the right as new data points are found and added. Instead, I see the data lines travel off the right side of the graph. I've tried to follow the Plot Gallery app (Real Time Plot); to no avail. I've looked at the other questions here that resemble my problem, but none of the answers

Change Tick Labels for Coreplot Graph

…衆ロ難τιáo~ 提交于 2019-12-13 02:18:14
问题 I am using coreplot for graphs in my mac application & its working fine. I have a requirement to show custom labels along the axis for ticks like : I have a graph for power values against time : Power values -> Y-Axis & Time -> X-Axis . I want to draw graph for Time seconds values but show fixed intervals ticks of minutes along x-axis for which i figured that i should use custom labels but its not happening for me. Code for custom labels is : let graph = CPTXYGraph() plots[0].identifier =

CorePlot axisLine and gridLine length too long

断了今生、忘了曾经 提交于 2019-12-13 00:29:53
问题 I'm using CorePlot for my current project and its amazing. The only problem I came across is the length of the axis and grids. I'm only using a positiv coordinate system with labels on the left and bottom side. And my problem is the length of the axis and grids in direction to my labels. I tried to use: axisSet.xAxis.orthogonalCoordinateDecimal = CPTDecimalFromString(@"-value"); axisSet.yAxis.orthogonalCoordinateDecimal = CPTDecimalFromString(@"-value"); or x.labelOffset = value; y

Core Plot: Increase space between ticks on the x-axis?

房东的猫 提交于 2019-12-12 15:23:05
问题 I have this code for making ticks and labels on the x-axis: CPTAxis *x = axisSet.xAxis; x.title = @"Hour of Day"; x.titleTextStyle = axisTitleStyle; x.titleOffset = 15.0f; x.axisLineStyle = axisLineStyle; x.labelingPolicy = CPTAxisLabelingPolicyNone; x.labelTextStyle = axisTextStyle; x.majorTickLineStyle = axisLineStyle; x.majorTickLength = 4.0f; x.tickDirection = CPTSignNegative; CGFloat dateCount = [timestamps count]; NSMutableSet *xLabels = [NSMutableSet setWithCapacity:dateCount];

Unable to have two CorePlot graphs show simultaneously

时间秒杀一切 提交于 2019-12-12 15:16:20
问题 I'm having an issue having two different CorePlot graphs show up in the same view. I've set up two hosting views in my view and all the referencing outlets are connected correctly. Only one of the graphs shows up correctly. Adding a quick NSLog to the numberForPlot method shows that only the first graph is being populated ( graph and graphView ) and not the second ( trend and trendView ). Here's the code: - (void) graphSetup { CPTTheme *theme = [CPTTheme themeNamed:kCPTPlainWhiteTheme]; graph