I have an iPhone project that displays some data of the past 24h in Core Plot. x axis shows the time, y axis the data value.
Now I want to highlight a day change by drawing a vertical line at midnight. How can this be done?
Add a scatter plot to your graph to draw the vertical line. Just give it two data points—one for each end of the line.
Related
I am using core plot framework for drawing the line graph in iPhone and it is working fine.I am displaying system time on X- axis and Temperature on Y- axis.I need to draw the cross hair vertical line that indicate the selected value on the line graph. for example
I would highly appreciate if someone can give me some suggestion to solve this issue.
Thanks in advance.
You can use another axis or scatter plot to draw the line. Using an axis is simpler if all you need is a single horizontal or vertical line. Set all of the tick and grid line styles to nil and use the orthogonalCoordinateDecimal to position it in the correct location. There is a demo using a scatter plot to draw a crosshairs over the selected point in the Mac version of the CPTTestApp example app.
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
The problem starts with the fact i have a very small area to plot a chart and i need to have markers on it as well. Now because of the small area, the markers are getting cut off and they are a key piece of information. So is there any way by which i can add some spacing between the border of the plot and the actual start of the data plot itself ?
Heres a running example: https://dl.dropboxusercontent.com/u/138190/charts/index.html
Set minPadding and maxPadding for xAxis. This will work as long, as yod don't have scrolling/panning options enabled.
How can I create a Time Chart with multiple Y scales and axis with AChartEngine? Thanks
You will have to build a CombinedXYChart of line charts and use custom labels instead of the default ones.
TimeChart is not supported in the CombinedXYChart.
Update: See this example and just create a time chart instead of a cubic line chart.
In Core-Plot I want to plot only the visible area of the plot. For this I need the visible range of the plot after Zoom-In and Zoom-Out.
Any Idea how to get visible range of X-Axis?
You can use a plot space delegate to find out when the plot ranges change. Each delegate method receives a reference to the plot space as one of its parameters. You can read the xRange and yRange to find out what the new ranges are.
You can get visible range of X-Axis using code like this:
space.graph.axisSet.xAxis.visibleAxisRange