piaoyongren / core-plot

Automatically exported from code.google.com/p/core-plot
0 stars 0 forks source link

"reloadData" with numberOfRecordsForPlot returning 0 does not clear graph. #226

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Setup graph.
2. Update data source to return 0.
3. Call reloadData

What is the expected output? What do you see instead?
Graph should be reloaded with 0 data points. Instead the graph does not change 
at all.

What version of the product are you using? On what operating system?
Development stream. 1-2 weeks old.

Please provide any additional information below.

I updated the CPTestApp-iPhone bar chart example with the following:

"int numData" member variable initialized to 16.

-(NSUInteger)numberOfRecordsForPlot:(CPPlot *)plot {
    NSLog(@"returning %d", numData);
    return numData;
}

Added new method, called by a timer
    [NSTimer scheduledTimerWithTimeInterval:5 target:self 
                                            selector:@selector(reloadWithoutData) userInfo:nil repeats:YES];

-(void) reloadWithoutData {
    NSLog(@"reloading data");
    numData = 0;
    [barChart reloadData];
}

Original issue reported on code.google.com by wwinder....@gmail.com on 24 Nov 2010 at 6:34

GoogleCodeExporter commented 8 years ago
This issue was closed by revision e4380b21c2.

Original comment by eskr...@mac.com on 25 Nov 2010 at 4:26

GoogleCodeExporter commented 8 years ago
Issue 234 has been merged into this issue.

Original comment by eskr...@mac.com on 20 Dec 2010 at 10:51

GoogleCodeExporter commented 8 years ago
If you're using 0.2.2 make sure you set your CPGraphHostingView collapsesLayers 
property to NO. Setting it to YES seems to cause this problem. You can do so by 
calling:

[graphView setCollapsesLayers:NO];

On your CPGraphHostingView object

Hope this helps!

Original comment by movinpi...@gmail.com on 26 Apr 2011 at 9:34