What are the differences between tickinterval and minTickInterval in HighCharts? Please explain - highcharts

What are the differences between tickinterval and minTickInterval in HighCharts?
I have tried in with many resources but could not get info.
Please explain

tickInterval sets the interval of tick marks in an axis, the minTickInterval sets the smallest tick interval allowed in an axis.
minTickInterval
The minimum tick interval allowed in axis values. For example on zooming in on an axis with daily data, this can be used to prevent the axis from showing hours. Defaults to the closest distance between two points on the axis.
tickInterval
The interval of the tick marks in axis units. When undefined, the tick interval is computed to approximately follow the tickPixelInterval on linear and datetime axes. On categorized axes, a undefined tickInterval will default to 1, one category. Note that datetime axes are based on milliseconds, so for example an interval of one day is expressed as 24 * 3600 * 1000.

Related

space proportional between points in x-axis

Is it possible in high-charts to show your X axis proportional to your data points.
Lets say my x axis data is [1,2,5,8,30,50] and these are say years.
I would like the chart to distance the points proportionally so the chart looks more reasonable to view. In this example while point 1, 2 would be closer but distance between 2 and 5 should be roughly three times distance between 1 and 2 and so on.
Basic idea is when you see how the values are changing between year 8 and 30 than visually it conveys right message to your brain.
Thanks
You can use the tickPositions feature and pass a wanted array of the xAxis values to achieve your requirements.
Demo: https://jsfiddle.net/BlackLabel/vm1eh4su/
API: https://api.highcharts.com/highcharts/xAxis.tickPositions

IOS Core plot how to get the nearest possible value of minimum Y axis value

I am using below code to calculate the range of YAxis value:
plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(yLow_NBH)
length:CPTDecimalFromFloat(yHigh_NBH - yLow_NBH )];
axisSet.yAxis.preferredNumberOfMajorTicks = 4.0;
axisSet.yAxis.labelingPolicy = CPTAxisLabelingPolicyEqualDivisions;
I want graph to start Y axis from best possible nearest value of Y minimum value.For example if Ymin is 5000 and intervals between two values is 500 then yAxis should start from 4500,5000,5500 and so on.
Thanks in advance
I need the graph as second image if the Ymin is 9000
First, I would stick with the default labeling policy, CPTAxisLabelingPolicyFixedInterval. You can choose the majorIntervalLength when you determine the preferred plot range and be assured the tick locations will fall at the desired values.
Take a look at how Core Plot determines tick locations with the CPTAxisLabelingPolicyAutomatic labeling policy (see this method). You can use the same algorithm to find the best tick interval and then adjust the starting location and length of the range to fall on even multiples of the tick interval. Note that Core Plot does all of the math with decimal values so it stays accurate with very large and very small values. You can use double values to simplify the code if you know your data will always fall in a range that won't cause numeric accuracy issues.

How to draw y-axis by dynamic values by using YLow and YHigh

I am using core plot library for drawing the graph. I always get dynamic values for y-axis and I calculate Ymin and Ymax from the result set. The difference between (Ymax-Ymin) may be very low or very high. I want to create dynamic intervals between these values. If the difference is low major interval should be less and if it is high major interval should be high. I can't set the preferredNumberOfMajorTicks static value as values may vary. The code should work for every case. Please guide me with some code example.
#Eric Thanks for the response. I tried both of your solutions.First oneCPTAxisLabelingPolicyEqualDivisions but it always divides the range in one interval say if yMax and yMin are (128.5 and 123.2) then one interval seems nice but if values are (5550-100) then also it shows only one interval with such a big difference of values.Secondly I tried with CPTAxisLabelingPolicyFixedInterval and calculated the majorIntervalLength with by dividing the length by different number of intervals,it works fine but again I don't want to keep the value of interval static .As if I divide the length by 4 then it will always create 4 intervals even for the very low values say 4.5 and 3.5. Can you please guide me if there is any way to calculate the no of intervals by yMax and yMin?
Try the CPTAxisLabelingPolicyAutomatic axis labeling policy. That will pick "nice" intervals within the plot range for the ticks and labels. You can use the CPTAxisLabelingPolicyEqualDivisions labeling policy to always divide the plot range into equal parts, although there are no guarantees that the ticks will be on
"nice" values. If you want the most control, stick with the default labeling policy (CPTAxisLabelingPolicyFixedInterval). Divide the length of the plot range (Ymax-Ymin) by the desired number of intervals to compute the majorIntervalLength.

CorePlot YAxis with two types of Scaling

Is it possible to achieve different scaling for positive part of Y-axis and different scaling for its negative part of Y-axis.The idea is to show most part of plot area for positive values and less part for negative values.
Set the yRange of the plot space so that 20% of the range is negative. For example, a range with a location of -25 and length of 125 meets this requirement.

Core Plot - X-Axis moving position when plotting less points

I have a strange problem where my x-axis moves down the plot area when I'm plotting less points. My graph has 2 lines plotted - 1 for previous year and 1 for current year values. My original graph always plotted 12 points for both lines, regardless of which month we are in and this works fine. I have now changed my app so that the current year line only plots points upto the current month. E.g. we are in May so I only plot 5 points. When I do this the x-axis moves down the plot area so that it is detached from the y-axis and the labels are hidden - see screenshots :
Why would simply reducing the number of plot points change the x-axis position? I'm using Core Plot 1.1 (static library) and Xcode 4.6.2.
The yRange of the plot space changed so the point where the x-axis crosses the y-axis is now too close to the bottom edge of the graph. You have two options:
Ensure the yRange always puts the crossing point (the "orthogonal coordinate") far enough from the edge that the labels and title remain visible.
Use the axisConstraints to position the axis a fixed distance from the edge of the graph. This will let the crossing point float along the y-axis.
The plotting library changes the x-axis position because generally core plot take the minimum and maximum range among the values of y axis. You when you provide only 5 points then the lowest value is taken from y axis values and there for x- axis position while when you were providing all 12 months values the lowest value of the rest of the month were 0 and therefore x-axis was at zero. You can change the maximum and minimum values for the y range in core plot.

Resources