Is there any way to automatically calculate the axis labels' step size in Highcharts ? - highcharts

I have 1000~ data labels on the xAxis and finding a way to automatically calculate the step based on the number of data labels and size of the charts.
Based on the documentation , if I do not set the step property of xAxis.labels , it will be calculated automatically, But in my case it is not.
Current output:
Expected output:
Currenlty the labels look as shown in the image. I'd expect the labels to drop automatically and do not show the ellipses. Any help would be much appreciated. Thanks.
-I'm using Highcharts-5.0.8

Related

QChart set tick with uneven space

In QChart, how can I set tick with uneven space? In the example chart below, notice the first grid is smaller than others. How is it actually done? Thanks.
You need to set the TickType of your QValueAxis to QValueAxis::TicksDynamic.
Then you can set a tick anchor (i.e. the value where the first tick should be placed, e.g. 80.0 in the example image you provided) and tick intervals (the value between ticks, e.g. 2.5 in the example image)
Please note that dynamic ticks were only introducted in Qt 5.12.

iOS Core Plot Get visible labels X axis

I am using Core Plot and I am really still new to it. I have searched but could not find the answer. I have allowsUserInteraction enabled. I have implemented zoom in/out with that. I want to be able to get first and last visible label on X axis every time when user has zoomed in/out. I know that there is willChangePlotRangeTo I have called there expandRangeByFactor method on my CPTMutablePlotRange. I want to be able to get every time text from first and last visible label on X axis. Is there any delegate method that I have missed?
Whenever you need to find out what the current axis labels are, call -layoutIfNeeded on the axis to make sure the labels are up-to-date and get the set of labels from the axisLabels property. Since it's a set, the collection is unordered. You'll have to search the whole set to find the first and last ones. Each label has a tickLocation that is the location along the axis and a contentLayer that is the label displayed at the location. The automatic axis labels are always CPTTextLayer objects, so you can extract the text property from there.

HighCharts: To restrict the length of bars in wind rose chart

We are facing issue in wind rose chart when displaying real data. The data values range from very small (100) to very large (1000000000). On rendering the data set in wind rose chart, as the max length has to be set according to the highest value, the smaller values are not visible.
As a workaround to this, we planned to restrict the length of the bars/ spikes in the chart to say 10px so that all the values are visible. But couldn't find a way to do so. In bar chart we can use minPointLength property.
Can anyone provide any help on how to restrict the length of bars or any other workaround for this?
Thanks in advance.
Use type: 'logarithmic' axis, see: http://jsfiddle.net/3pEbJ/
Thanks a lot. It worked in our case. Would like to add few points for the modifications required for using this property.
1. On using “type: 'logarithmic'” property, if the data series contains value 0 for any value, JavaScript will throw error #10 ‘Can't plot zero or subzero values on a logarithmic axis’. To avoid this error you need to change the zero value to some non-zero value. This scenario occurs for stacked series.
2. Providing non-zero value will render that value in tooltip also. So as a workaround, we can provide the non-zero value like 0.00001. This way it will display value 0 in the tooltip for that series and also the corresponding bar would be very small.

Highcharts highstocks - candlestick graph has last value partially cut

In a candlestick graph i am building, the latest bar is cut-off partially such that even the bar is not visible. Thus it's difficult to judge the high and low by seeing the bar.
I'm unable to post a pic now but it's like the last rectangle being cut in half.
I'm tried a lot of options in the api but can't figure out why this is not showing correctly. The chart margin and axis offset options havent' helped. Is there a way i can set the series margin from the plot area so that it displays right.
For this problem, the best solution is to insert a dummy series which should be hidden from every aspect of the chart. So try this, insert a dummy series from the last point of the data series to some extra buffer(as per need). Then remove this series from the chart by explicitly removing it from the legends (using showinlegend),chart(setting linewidth to 0) and from tooltip by having a check in formatter. Hope this solves your problem.
I had the same problem and couldn't figure it out, because no matter how I changed the xAxis.maxPadding or changed the xAxis.max, it would always cut off the last candlestick when I clicked on the range selector.
To solve it, (hack) I just added an extra data point in my series and set it 1 day past the last day and set all values to null.
Without any code or a pic, it's hard to tell the problem, but it sounds like you need to use the max padding option. http://api.highcharts.com/highcharts#xAxis.maxPadding. You may also want to look at endOnTick as well as whether you are setting max on the axis.

How can I make Core Plot to show an x-axis label for each point in time?

Apart from the issue I am trying to fix atm, I would like to know how I can make the x-axis labels to draw wherever there is a point drawn. As you can see on the screenshot there are three points in time. So instead of the label "1/10/54' (yes that is year 54) floating nowhere, I want three labels, one below each point.
(Note the 3 points are only for illustration, needs to be expandable.)
If the spacing between the labels will be irregular like your sample screenshot, you'll want to change the axis labeling policy to CPTAxisLabelingPolicyNone or CPTAxisLabelingPolicyLocationsProvided. Both policies require you to provide the tick locations. The first policy also requires you to make custom labels that don't have to be at the same locations as the tick marks while the second will automatically make labels at each tick location using the standard label formatter.

Resources