Note that there are some explanatory texts on larger screens.

plurals
  1. POCore Plot Bar Graph Y-Axis issues
    primarykey
    data
    text
    <p>I am trying to make a bar graph with core plot. I cannot get the y-axis to scale properly or the tick-marks in the correct places. My biggest issue is that if I set:</p> <pre><code>CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *) graph.defaultPlotSpace; plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDEcimalFromFloat(0) length:CPTDecimalFromFloat(max_value); </code></pre> <p>And max_value is anything higher then 10 it takes an unreasonable amount of time for the graph to load. For example I need max_value to be around 1000 to show the tops of all the values but when I set it to 1000 it takes over 15 seconds to load the screen. But if I leave it set to 10 my bar graphs take up the entire screen and you cannot see the top. </p> <p>This is the rest of the part of the code dealing with this. Any advice would be appreciated.</p> <pre><code>CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *) graph.defaultPlotSpace; plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0) length:CPTDecimalFromFloat(1000)]; [plotSpace scaleToFitPlots:[NSArray arrayWithObjects:_liftOffPlot,_sideLeanPlot,_forwardLeanPlot,_crossLegsPlot,nil]]; graph.plotAreaFrame.borderLineStyle = nil; axisSet.yAxis.title = @"times completed"; axisSet.yAxis.titleTextStyle = axisTitleStyle; axisSet.yAxis.titleOffset = -25.0f; axisSet.yAxis.axisLineStyle = nil; axisSet.yAxis.labelingPolicy = CPTAxisLabelingPolicyAutomatic; axisSet.yAxis.preferredNumberOfMajorTicks = 10; axisSet.yAxis.minorTicksPerInterval = 1; axisSet.yAxis.minorTickLocations = nil; axisSet.yAxis.majorTickLocations = nil; axisSet.yAxis.title = @"times completed"; axisSet.yAxis.titleTextStyle = axisTitleStyle; axisSet.yAxis.titleOffset = -25.0f; axisSet.yAxis.axisLineStyle = nil; axisSet.yAxis.majorIntervalLength = CPTDecimalFromString(@"100"); axisSet.yAxis.orthogonalCoordinateDecimal = CPTDecimalFromString(@"0"); axisSet.yAxis.visibleRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromInt(0) length:CPTDecimalFromInt(1000)]; axisSet.yAxis.gridLinesRange = axisSet.yAxis.visibleRange; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload