kevinzhow / PNChart

A simple and beautiful chart lib used in Piner and CoinsMan for iOS
MIT License
9.72k stars 1.76k forks source link

Remove line charts from the chart #148

Open aminasadi0 opened 9 years ago

aminasadi0 commented 9 years ago

Hi,

How can I remove the line chart from the chart canvas after that has been stroken? I tried:

upLeftChart.xLabels = nil; upLeftChart.yLabels = nil; upLeftChart.xChartLabels = nil; upLeftChart.yChartLabels = nil;

stroke crash and update only remove the xlabels. Ylabels will becomes to high numbers and the most important one, the plot, will not remove

nelanelanela commented 9 years ago

I'm having the same issue. Is there any quick fix?

nelanelanela commented 9 years ago

What I ended up doing is just setting the data to 0:

    PNLineChartData *data = [PNLineChartData new];
    data.itemCount = 1;
    data.getData = ^(NSUInteger index) { return [PNLineChartDataItem dataItemWithY:0]; };

    [self.chart setChartData:@[data]];
    [self.chart strokeChart];

Maybe it'll help you.

aminasadi0 commented 9 years ago

I just switched back to core plot :/

On Wed, Feb 11, 2015 at 5:28 PM, Natalia notifications@github.com wrote:

What I ended up doing is just setting the data to 0: PNLineChartData *data = [PNLineChartData new]; data.itemCount = 1; data.getData = ^(NSUInteger index) { return [PNLineChartDataItem dataItemWithY:0]; }; [self.classroom15MinCountChart setChartData:@[data]]; [self.classroom15MinCountChart strokeChart];

Maybe it'll help you.

Reply to this email directly or view it on GitHub: https://github.com/kevinzhow/PNChart/issues/148#issuecomment-73911766