last day (18 days later) » 

1:01 AM
0
A: core-plot x-axis label not visible - bounding rects?

Eric SkrochThe statement x.labelFormatter = nil; eliminates the automatic axis labels. If you supply a label formatter and label text style, the axis will create ticks and labels automatically based on the labeling policy.

 
Hmm; that line is not sample original;idk where it from but removing throws: NSParameterAssert(idx < categories.count); in CPTPlotSpace ?
That line came from a different bar example but removing it can be remedied by adding categories: [barPlotSpace addCategory:@"Percentage" forCoordinate:CPTCoordinateX]; [barPlotSpace addCategory:@"Entries" forCoordinate:CPTCoordinateY]; but for some reason my plots are now off by 1 (higher) ? ie., bar at 1 now at 2, etc ? `
 
Please show the datasource methods, too. There's something wrong with the way you're using categorical data.
 
Full module posted.
 
The barPlotSpace.xRange is too long—the axis is trying to create labels for locations past the last category.
 
Hmm, not following; the range is the number of items I have? I'm not using horizontal bars. I altered listing to reflect adding a category for each Y values - that is 4 categories per data item, and 1 category added per X category one per item. This was in response to examining the args to the assert which seems to be what it was after, The segv is gone but still no labels?
 
1:01 AM
Only the x-axis is set up to use categories. It's hard to follow what the data looks like. How many category labels should there be?
 
By adding the various categories I got rid of the error and saw tips of the x-axis label; trial and error in altering the bar plot space and x-axis ranges I'm able to get closer to what I need: link I still need to have some things (see arrows) removed and desire the x-axis text style to match the style used at label top. Ideally would like a 2 line x-axis label but all the plots disappear when I tried that (\n) inserted in text.
I still not sure just what a category is but each bar is 4 plots, sourced from a single item object; It appeared to want n-categories to match the number of items. For good measure I added a Y category for each of the values.
 
A categorical axis (e.g., setScaleType:CPTScaleTypeCategory) is used to plot data that is grouped into discrete categories instead of numeric values. Internally, Core Plot converts the category labels into a sequence of integer index values between zero (0) and n-1 (n is the number of categories). It's basically a shortcut so you don't have to keep track of the mapping between categories and index values in your app.
 
Ok, that's a bit beyond me if you look at the link each "bat" is made up of up to 4 plots;actually it's always 4 but some are zero height; for all their bases vary but they all should total 1.0 - or 100%. I don't need/want the "0.0" at the origin and trying to figure out where the "1.0" is coming from, sometimes displayed atop the bar. Anyway, I think if I understand I have n-categories each with 4 values?
 
 
1 hour later…
2:16 AM
It looks like you have the categories figured out.
The 0.0 in the lower left is a y-axis label. Set the y-axis labelTextStyle and/or labelFormatter to nil to remove it. Set the labelTextStyle on the x-axis to format the labels.
The small numbers above the plots are data labels. It looks like you're building custom labels, so set the labelTextStyle property on each plot to nil to remove the default labels. In the -dataLabelForPlot:recordIndex: method, check the plot parameter and only create data labels for the white plot.
 
 
11 hours later…
1:23 PM
K, removed the y-axis label thanks. Ah ha (!) - the category name string must match the value used for CPTBarPlotFieldBarLocation in the dataSource, otherwise no plots. Aside from color, x-axis text style doesn't seem to affect display; I'm trying to match coloring to bar top - see link
 

  last day (18 days later) »