Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to display any thing in line chart. #2712

Closed
eeyrw opened this issue Aug 13, 2017 · 1 comment
Closed

Fail to display any thing in line chart. #2712

eeyrw opened this issue Aug 13, 2017 · 1 comment

Comments

@eeyrw
Copy link

eeyrw commented Aug 13, 2017

After investigating the demo of osx and ios for a while, I wrote the minimal function code to show a simple line. But it seems far from normality :
image

Here is my code:

...
@property (weak) IBOutlet LineChartView *lv;
...
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    NSMutableArray *values = [[NSMutableArray alloc] init];
    
    for (int i = 0; i < 200; i++)
    {
        double val = i;
        [values addObject:[[ChartDataEntry alloc] initWithX:i y:val]];
    }
    
    LineChartDataSet *set1 = [[LineChartDataSet alloc] initWithValues:values label:@"DataSet 1"];
    NSMutableArray *dataSets = [[NSMutableArray alloc] init];
    LineChartData *data = [[LineChartData alloc] initWithDataSet:set1];
   
    self.lv.data = data;
    [self.lv animateWithXAxisDuration:0 yAxisDuration:1];
    
    
}
@liuxuan30
Copy link
Member

liuxuan30 commented Aug 14, 2017

You should follow what the demo shows you... I don't know what's going on your chart neither with your piece of code. You have to check many things to make sure the chart is correctly initialized, rendered on your side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants