ios-charts - problems using autoScaleMinMaxEnabled - ios-charts

I try to auto scale the y-axis for an LineChart. If I set the option autoScaleMinMaxEnabled, followed by an notifyDataSetChanged no auto scale occurs.
Also toggeling autoScaleMinMaxEnabled in ChartsDemo seems not to work. Is there a special trick?
Many thanks! - Tino

The "trick" is that min/max of the Y-axis is determined dynamically, during scrolling, depending on the y-values that are contained in the visible x-range.
If you want to see it working in the demo, then zoom in, enable autoScaleMinMaxEnabled, and then scroll to the right. Watch the Y-axis.

Related

Sigmaplot: How to scale x-axis for correctly displaying boxplots

I want to display overlapping boxplots using Sigmaplot 12. When I choose the scale for the x-axis as linear then the boxes do indeed overlap but are much too thin. See figure below. Of course they should be much wider.
When I choose the scale of the x-axis to be "category", then the boxes have the right width, but are arranged along each single x-value.
I want the position as in figure 1 and the width as in figure 2. I tried to resize the box in figure 1 but when I choose 100% in "bar width" than it still looks like Figure 1.
many thanks!
okay, I found the answer myself. In Sigmaplot, there is often the need to prepare "style"-columns, for example if you want to color your barcharts, you need a column that holds the specific color names.
For my boxplot example I needed a column that has the values for "width". These had to be quite large (2000) in order to have an effect. Why ? I have no idea. First I thought it would be because of the latitude values and that the program interprets the point as "1.000"s, but when I changed to values without decimals, it didnĀ“t get better.
Well, here is the result in color.
Have fun !

Core plot - disable scaling and scrolling in the y direction, not x

I'm working on a graph displaying dates on the x-axis, and percent on the y-axis (1-100). I have got the graph to show kind of the way I like, but I want to disable the ability to scroll and scale the graph in y-direction, so the values 1-100 always is displayed at the same scale. However, I cannot disable user interaction completely, as I want the user to be able to scroll (and perhaps scale) in the x-direction as the number of dates gets bigger, and touch the nodes to display values.
I was able to to this in s7graphview, which I was using before, but haven't been able to get this to work with iOS 5. Also, the smooth scrolling I got from the scrollView in s7 had been fine to have in Core Plot :)
//for stop vertical scrolling
-(CGPoint)plotSpace:(CPTPlotSpace *)space willDisplaceBy:(CGPoint)displacement{
return CGPointMake(displacement.x,0);}
-(CPTPlotRange *)plotSpace:(CPTPlotSpace *)space willChangePlotRangeTo:(CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate{
if (coordinate == CPTCoordinateY) {
newRange = ((CPTXYPlotSpace*)space).yRange;
}
return newRange;}
The easiest way to do that is to set the globalYRange of the plot space to the same range as the yRange. If you need to expand the yRange later, remember to remove the globalYRange first (set it to nil).
To get more control, you can use a plot space delegate. Implement this method:
-(CPTPlotRange *)plotSpace:(CPTPlotSpace *)space
willChangePlotRangeTo:(CPTPlotRange *)newRange
forCoordinate:(CPTCoordinate)coordinate;
You can use this method to modify the proposed change to the plot range.

CPBarPlot Width/Spacing

I am modifying the width of bars in a graph by using (CPBarPlot *)barPlot.barWidth, but the spacing between bars does not change and they now overlap each other. barPlot.barOffset works great for the initial offset, but I haven't been able to figure out how to change the spacing between subsequent bars. It seems like I have to change something with the spacing of intervals on the axis, but I don't see anything related to interval spacing in CPBarPlot. Anyone know how this can be accomplished?
Here's a post that might help out with this issue: http://mela.ertale.com/blog/?p=193
Good luck!

how to restrict scrolling for +ve part in cpxygraph

I am new to core plot SDK, implemented core plot in my app. i need to restrict -ve part of graph. i.e always i will have +ve values for graph((1,1),(10,15),(20,15)).i need horizontal , vertical scrolling for +ve part only.So i want to restrict remaining 3 parts of graph. I tried in all ways help less, so posted here. if any one already done with this type requirement, please help me ASAP.
Thanks in advance.
The easiest way to restrict the scrolling ranges is to set the globalXRange and globalYRange properties on your plot space. If you want more control, you can use a plot space delegate. CPTestApp (the Mac version) demonstrates both techniques.

how to set custom interval to horizontal axis in Flex Charts

I am trying to set custom step (interval) to my Line Chart's horizontal axis.
The chart gets its data from a grid. The grid has a lot of data and it is displayed accurately but because there are so many data points the horizontal axis is screwed up. I wanted to set a step on horizontal axis so that you get an idea when you see the graph without hovering the mouse on a data point!
thanks for any help!
-Ali
Flexi Comment Box
heylo people!
I have solved the mystery!!!
just add a horrizontalAxisRenderers to your Chart
and set the property canDropLabels to true!
<mx:horizontalAxisRenderers>
<mx:AxisRenderer axis="{horiAxis_B}" canDropLabels="true"/>
</mx:horizontalAxisRenderers>
axis being the name of the axis
you are done!!
but if you still have questions, you can always contact me here:
Alimsyed.com