I want to disable zoom from my HighStock chart navigator's. I mean, don't allow the user to resize the selector in the navigator, just drag it.
I have tried settings axisX min and max but it only set the initial values. I also found xAxis#minRange but there is not an option like xAxis#maxRange so I can set min and max range to the same value to avoid zooming.
Is this possible?
You have to set the zoomType: 'none', property.
Related
Automatically legend title has style text-overflow: ellipsis;, but I need to show all text from legend title. So, I need to set text-overflow: clip;.
When user change window size, legend items overlapping each other or
move to outside of chart container.
You can reproduce it here: https://jsfiddle.net/6ybv9kjx/6/
For reproduce you should change window size, when chart initialized.
Also, legend items showing be a certain rule. If all text in legend item doesn't placed in one line with previous item, item move to next line. I need, that legend item can breaking words. Is it possible?
The useHtml is a know problem.
For now if you don't really need it just disable it.
Fiddle
You can solve this issue by redrawing the chart whenever the browser window is resized. That way, the legend elements will be rendered based on the new width of the window.
Assign your chart options to a variable, which you'll then call each time the window is resized.
var thisChartOptions = {
/* your options go here */
};
/* draw chart when the browser window is loaded or resized
(see https://stackoverflow.com/a/1974797/2596103) */
$(window).on('resize', function() {
Highcharts.chart('container', thisChartOptions);
}).resize();
You can see this working in this fiddle: https://jsfiddle.net/brightmatrix/6ybv9kjx/43/
I tried using the legend.update() function (see https://api.highcharts.com/class-reference/Highcharts.Legend#update), but the legend items would overlap each other when the window was made smaller.
I have a column report it's height is getting increased when disable and enable the legent item.
fiddle http://jsfiddle.net/vozq9eq6/
Click the report and drill down first level.
Disable the legend and enable it.
Now the column height is getting increased.
How to disable it?
I am using highcharts where I need extra padding on my chart. When I use navigator and zoom in I the padding is lost - which is fine as I am zooming in. However when I zoom out using Navigator I don't get my padding back. Alternatively if I use the zoom button on chart I get the padding back (I would expect the same behaviour from navigator as well when I try to zoom out).
I've copied a sample chart form Highcharts Demo on jsFiddle http://jsfiddle.net/gajjargaurav/RULh9/5/ with Navigator and http://jsfiddle.net/gajjargaurav/RULh9/4/ with Zoom button
The padding I have set is as below for my sample,
xAxis: {
maxPadding: 0.22, //Prevent chart going off the screen on the right
minPadding: 0.22,
tickPosition: 'outside'
}
The question is, how I can get the navigator to behave like the zoom button does when I try to zoom out using navigator?
Unfortunately min/maxPadding works only for initial state. If you want to improve your range in that way, I advice to use afterSetExtremes event handler, and there setup new extremes( just increase that one you get).
Note: When setting new extremes in afterSetExtremes, will call another afterSetExtremes. Make sure. Make sure that you will not create infinite loop (add some flag checking if extremes are already improved, or not).
I have a basic two axis line chart, with one series. Its data are datetime on xAxis, and average numbers for yAxis. When I load the page with my chart, I have a nice xAxis display with a label for every other month, which allows the chart to be nicely presented, and readable.
Whenever I click the legend button to hide this series, (I still show the xAxis even if the chart is now empty), and then click it again to show it, the xAxis now displays every month (twice as many as before) and the label texts are overlapping each other.
If I try to hide and display the series again, I have the same result.
Could it be that once the hide function is fired by the legend button, it is deleting some of my options, or is changing them automatically?
Basically, all I want is to keep the "every other month" label display for my xAxis, no matter how many times I hide or toggle my series.
EDIT : I tried to set chart.ignoreHiddenSeries to false and the xAxis is not changing anymore, but I kinda wanted to keep the scalable feature for the yAxis... And now when I toggle or hide another series, the yAxis stands still.
Any workaround? This is just a half solution for me.
You can try to use showEmpty() function http://api.highcharts.com/highcharts#xAxis.showEmpty
I would like to know how to implement the slider similar to the one in the Ipad default calendar application. I have attached the image below
If you see at the bottom, it acts like a slider which allows us to select any month either by just pressing it or sliding to it.
It would be great if anyone could tell me the name of that control. I tried using UISlider but I see that it allows only 3 options:
setThumbImage
setMinimumTrackImage
setMaximumTrackImage
If that control is indeed a slider control, could anyone tell me how I would be able to insert multiple images/ text
Thanks
It may be more complex than you'd like, but you could make your own:
Make a background that has UILabels for the dates
Make a selection box
In the UIViewController you could put something such as:
touchesMoved -
Make the selection box's x value equal to the touch
touchesEnded -
Make the selection box's x value equal to the touch's last x value
The touches moved would allow dragging of the selection box, and the touchesEnded would allow tap selection.
Then you would simply animate the selection box to the x value.
(This is an extremely simplified version, but you could do this pretty easily.)
This can be achieved by using UIScrollView. Add UIButtons programmatically having background images and text as well on them as per your requirement.
You can refer tutorial1 tutorial2 in which on screen only 1 page(Image) is displayed. You need to do some calculation for applying same logic to fit your requirement. i.e. Your scrollview will be smaller(in height) and bigger(in width) as displayed in image, you will be adding UIButtons in spite of images and most important at a time displaying more than 1 item but it won't be difficult. The Main part is only programmatically scrolling.