objective c - iOS-charts with exponential x-axis -
i have requirement plot graph y-axis range (-15 db 15 db).
plot values got float array -e.g
float plotval[] = { 0.707087f, 0.715769f, 0.724338f,......};(contains 560 points)
my x-axis value should range 20 hz 20,000hz in logarithmic scale shown in image
i using ios-charts , populating values as
nsmutablearray *xvals = [[nsmutablearray alloc] init]; int xcount = 560; (int = 0; < xcount; i++) { [xvals addobject:[@(i) stringvalue]]; } nsmutablearray *yvals = [[nsmutablearray alloc] init]; int ycount = 560; (int = 0; < ycount; i++) { [yvals addobject:[[chartdataentry alloc] initwithvalue:plotval[i] xindex:i]]; }
how change scale values shown in image,please help.
currently, ios-charts not support such scenarios. filed request support, needs decent work on it.
the thing try understand how ios-charts draw line chart, , create new chart based on framework. can so.
the hard part is, rewrite xaxis, , figure out how calculated coordinates.
it's long story explain every details, , code can tell everything, try.
Comments
Post a Comment