coreplot Xaxis start value iOS 7 - ios

I am developing an Area chart like the following and facing the following issue.
curve shape is not looking proper, i need a smooth curve.
X-axis values are Dynamic, it May start with 40 or May be 60 or
any other value.how to calculate that ?
Any Help will be greatly Appreciated.

To make the line smoother, either give it more data points or make a curved plot.
plot.interpolation = CPTScatterPlotInterpolationCurved;
If you know the range of data values, just set the xRange directly. Remember to set the location to the min value and the length to (max - min). You can also have the graph scale the plot space for you.
[plotSpace scaleToFitPlots:[graph allPlots]];

Related

Is it possible to always set 0 in the center of Charts's Y-axis with swift charts lib?

According example image I want to create my chart like that. My data entries have both positive and negative values, I want to set 0 in the middle of y-axis everytime.
Is impossible to do that?
Ps. I use Charts library with swift version 5.
Calculate the biggest number on the Y-axis in the chart's dataSet.
let maxValue = max(dataSet)
chart.setChartMinMaxYValues(chartYMin: -(maxValue), chartYMax: maxValue)

iOS Core-plot: How can i start labels on y-axis from a certain value?

I am using core plot to generate graphs for some NUMBERS vs dates, I want to start labels on y from minimum NUMBER(or close to minimum) like IMAGE 1.
I landed up in doing this with range.
plotSpace.yRange = CPTPlotRange(location:minimumValue-10,length:maximumYaxisValue-minimumValue+20)
All i want to do is to get the minimum NUMBER as the starting label on y-axis (or close number like in image 1)
I have tried many things but nothing worked out, any help is greatly appreciated. Thank you :)

No Vertical Gridlines?

I have a small problem with Core-Plot library (1.5.1 version). I'm creating application for iOS that plots some data collected from the Internet. I want to display vertical grid lines, I'm using custom labeling so I have to set majorTickLocations on my own. Everything works OK, but the problem is, when all data that I want to plot has a value of 0.0, the vertical grid lines do not appear.
How can I fix this?
Ok - I was my mistake. The problem occured beacuse I have some logic for rescaling plotSpace when I reload plot. So when all data has 0.0 values my logic set plotSpace range as [0, 0] (range starts from 0 and has 0 length). There was simply no space for gridlines.

How to auto adjust Y axis plot lines in live high chart

How to auto adjust plot lines in live plot
for example:Plot line i set to value:1.25 and random data are coming between 1-2.plot line will be visible.this works fine.suppose random data coming in the range 100-200,plot line will become hidden. i want to adjust plot lines irrespective of random data we generate.plot lines always visible.
set the max plot line value to any fixed number plots the plot line.
from then onwards the plot line will be visible. if the value of plot lines is very small compared to the scale then it may be tough. in this case go for a logarithmic scale. That will help.
yAxis:{
type: 'logarithmic'
}
updated your fiddle at http://jsfiddle.net/z6QXW/12/
hope this will help you

CorePlot axisLine and gridLine length too long

I'm using CorePlot for my current project and its amazing.
The only problem I came across is the length of the axis and grids.
I'm only using a positiv coordinate system with labels on the left and bottom side.
And my problem is the length of the axis and grids in direction to my labels.
I tried to use:
axisSet.xAxis.orthogonalCoordinateDecimal = CPTDecimalFromString(#"-value");
axisSet.yAxis.orthogonalCoordinateDecimal = CPTDecimalFromString(#"-value");
or
x.labelOffset = value;
y.labelOffset = value;
but this is only setting the distance of my labels different and not affecting the grids length.
In my example the y-axis and there grid overlaps my label:#{1,2,3,4,5,6,7,8}
Did somebody dealed with the same problem? THX for all answer to the right way!
Use the visibleRange and gridLinesRange to limit the axes and grid lines, respectively. See the "Control Chart" in the Plot Gallery example app for sample code.

Resources