PNChart icon indicating copy to clipboard operation
PNChart copied to clipboard

Skip some Xvalue

Open aminasadi0 opened this issue 10 years ago • 3 comments

I was wondering if we can give 2arrays for Xaxis. One which will be the labels underneath the X-Axis and the second is the real Xdata (some of the 1st array) which will have corresponding Yvalues.

I'm trying to figure out in the PNLineChart but getData block in below snippet confuses me how to do this:

-(PNLineChartData_)chartDataForYData:(NSArray_)yArray{

//converting yArray to PNLineChartData
PNLineChartData *chartData = [PNLineChartData new];

chartData.color = [[VCECommon2 sharedObject] getRandomColor];

chartData.itemCount = self.xLabels.count;

chartData.getData = ^(NSUInteger index) {
    CGFloat yValue = [yArray[index] floatValue];
    return [PNLineChartDataItem dataItemWithY:yValue];
};

return chartData;

}

aminasadi0 avatar Jan 20 '15 10:01 aminasadi0

I'm interested with this issue too! I have a lot amount of data. I want to display all the points on the line chart but only few X labels with a regular interval. Maybe looking to the Y axis display method will help.

romain64 avatar Aug 19 '15 18:08 romain64

Sovled?

roimulia avatar Jun 07 '17 15:06 roimulia

@romain64 @aminasadi0

roimulia avatar Jun 07 '17 15:06 roimulia