highcharts range selector buttons spacing issue - highcharts

I'm trying to resize the range selector. i'm able to change button sizes but they are coming close to each other. how can i increase the font size without increasing the space between buttons. Thanks in advance.

You can control the rangeSelector buttons by buttonSpacing and buttonTheme options. Setting a fixed width should be enough in your case:
rangeSelector: {
buttonSpacing: 5,
buttonTheme: {
width: 30,
style: {
fontSize: 16
}
}
}
Live demo: http://jsfiddle.net/BlackLabel/5f6aro7t/
API Reference: https://api.highcharts.com/highstock/rangeSelector.buttonSpacing

Related

Highstock padding/margin with range selector

For the following jsFiddle,I want to use the rangeSelector (but do not want to show them on chart) because I want the chart always show the data for 3 months, which means I cannot disable the range selector.
To hide the range selector I have used:
buttonTheme: {
visibility: 'hidden'
},
labelStyle: {
visibility: 'hidden'
}
Now on top of chart there is a space/blank area. I want to hide it. The reason is I want to show the chart in a small box. And this blank area because of range selector looks awkward in layout. I am thinking is there a way to add negative margin below range selector buttons?
You can set chart's margin, spacing top to negative value.
chart: {
renderTo: 'container',
spacingTop: 0,
marginTop: -35
},
Or better, set the range selector's height to 0.
rangeSelector: {
height: 0,
example: http://jsfiddle.net/cpvLzLso/34/

why setting div's height and width lose bar's label in highchart?

I need to draw a bar chart and need to set width and height for the container div (as there is only that amount of space I can use)
However, when I set height and width, in some cases, highchart will not draw some of the bar labels, even though I think there are places to draw them. Can someone explain this or maybe provide a workaround (without removing height)?
The jsfiddle is http://jsfiddle.net/daxu/md2zk/68/
labels: {
style: {
color: 'black',
fontFamily: 'DINPro',
fontSize: '7.8409px',
fontWeight: 'normal'
},
formatter: function () {
return this.value;
}
}
At the beginning, remove datalabels configuration per each point and use common options. There, you can disable hiding labels by crop option.
Example: http://jsfiddle.net/md2zk/70/

high charts: in bar labels only showing on some bars

using HighChart bar chart. aiming for big font labels on the bars
have increased font size in the datalabels.style.fontSize = 50
but labels only show in 2 of the right hand columns!
making font smaller (e.g. 30) it only shows in one bar... weird!
http://jsfiddle.net/py6txbr9/57/
dataLabels: {
enabled: true,
style: {
fontSize: 30,
color: 'white'
}
},
welcome any thoughts if this is happened to anyone else - can't find any bugs or issues else where.
thanks
Defaulty databales are printed "above" column, so when you set white color, there are "invisible". The solution is set "inside" flag as true and verticalAlign as top
dataLabels: {
enabled: true,
verticalAlign:'top',
inside:true,
style: {
fontSize: 30,
color: 'white'
}
},
Example: http://jsfiddle.net/py6txbr9/59/

Highcharts zIndex of Y-Axis title

I have a little problem. I use the high charts gauge diagram and the dial covers my title of my y-axis. I tried to solve this problem with the zIndex property for my title, like this:
yAxis: {
title: {
text: 'Title Y-Axis',
y: 20,
style: {
fontSize:16,
zIndex: 3
}
},
Unfortunately, it doesn't work. Does anybody have an idea how I put the title in the foreground so that the dial doesn't cover my title?
Thank you in advance.
You need to set useHTML parameter as true.
Example: http://jsfiddle.net/0kdnncvu/2/

Align left multi category xaxis highchart

Image 1
Image 2
I want to align left the label but when i do this, the label a stack on other like Image 2.
Please help me
This one works without fixed width:
.highcharts-axis-labels span {
left: 0 !important;
}
Since it uses the width of the biggest label and moves the smaller once by raising the "left" value, you can prevent that by setting it fix to 0. So no need of fix width or "align: left".
Update:
Labels "useHTML" setting must be set to true to work!
xAxis: {
labels: {
useHTML: true,
You can also set useHTML as true, use formatter for labels and then use CSS styles.
http://api.highcharts.com/highcharts#xAxis.labels.useHTML
http://api.highcharts.com/highcharts#xAxis.labels.formatter
EDIT:
http://jsfiddle.net/2QREQ/3/
xAxis: {
labels: {
//align: 'center'
useHTML:true,
formatter:function(){
return '<div class="label">'+this.value+'</div>';
}
}
},
CSS
.label {
text-align:left;
width:60px;
}
Give the green and the blue bar a container div/span. Then apply for both of the label and the container span/div a 'display: inline-block' css.
By doing so you would force the bars to 'give space' for the label.

Resources