Arearange highchart - highcharts

Is it possible to make an arearange series like the following? :
I saw the option to set oppacity, but that will give the series like the following:
Is there a way to hide the top line or to set the opacity of top line only?

You can set only lineWidth for whole area-range series. Instead you can disable that line, and use separate series: http://jsfiddle.net/9agdf5ar/
series: [{
name: 'Temperature',
data: averages,
zIndex: 1,
marker: {
fillColor: 'white',
lineWidth: 2,
lineColor: Highcharts.getOptions().colors[0]
}
}, {
name: 'Range',
data: ranges,
type: 'arearange',
lineWidth: 0,
linkedTo: ':previous',
dataLabels: {
enabled: true
},
color: Highcharts.getOptions().colors[0],
fillOpacity: 0.3,
zIndex: 0
}]

Related

HighChart - Stacked Bar chart - To show dash line over the bar chart but it is not visible on Left side of the bar

I have attached the screenshot to show the dash line in left side of the chart. It would be helpful if we can achieve the functionality and I tried to increase the width of the border, it is visible slightly. Do you have any proper approach to achieve this?
Code Snippet :
Highcharts.chart('container', {
chart: {
type: 'bar',
charWidth: 520,
chartHeight:300,
margin: [70,0,0,0]
},
xAxis: {
categories: ['Jan'],
visible: false
},
yAxis: {
min: 0,
visible: false
},
plotOptions: {
series:{
stacking:'normal'
},
dataLabels: {
enabled : false,
}
},
series: [{
name: 'John',
data: [{
y: 15
}]
}, {
name: 'Jane',
data: [{
y: 22
}]
}, {
name: 'Joe',
data: [{
y: 33,
}]
}, {
stacking: false,
data: [55],
grouping: false,
dashStyle:'ShortDash',
color: 'transparent',
borderWidth: 2,
borderColor: 'red',
}]
});
Thanks for the response
[![enter image description here][2]][2]
The left side of the bar is connected to the xAxis, which makes the left border less visible. There are some possible solutions to this issue.
You can set the minimum value of the xAxis to -0.1 and set startOnTick property to false. Then the left border is visible (it's not directly connected to the axis).
Demo:
https://jsfiddle.net/BlackLabel/pqy84hvs/
API references:
https://api.highcharts.com/highcharts/xAxis.startOnTick
https://api.highcharts.com/highcharts/xAxis.min
yAxis: {
min: -0.1,
visible: false,
startOnTick: false
}
You can set the borderWidth property to 3. Then the border is visible.
Demo:
https://jsfiddle.net/BlackLabel/01m6p47f/
API references:
https://api.highcharts.com/highcharts/series.bar.borderWidth
{
name: 'Joe',
borderWidth: 3,
borderColor: 'red',
data: [{
y: 33,
}]
}
You can also use SVG Renderer and render the border yourself.
Docs:
https://api.highcharts.com/class-reference/Highcharts.SVGRenderer
Example demo of using SVG Renderer:
https://jsfiddle.net/BlackLabel/2koczuq0/

High Charts Polar / Spider chart with off-graph y-axis labels

I'm trying to create a Spider graph that has the y-axes labels offset with extended gridlines.
Is this possible to achieve with just one graph, or do I have to create two separate graphs and overlay them? I've tried ticklines, gridlines, and they all get stuck in the polar coordinates.
Here's my attempt at trying to accomplish this:
http://jsfiddle.net/6d6jrfhs/3/
{
chart: {
polar: true,
type: 'line'
},
title: {
text: "# of Impacts",
x: -80
},
pane: {
size: '80%',
startAngle: 0,
},
xAxis: {
categories: ['Back', 'Left', 'Front', 'Top',
'Right'],
tickmarkPlacement: 'on',
lineWidth: 0
},
yAxis: {
gridLineInterpolation: 'polygon',
lineWidth: 0,
min: 0,
offset: 0,
labels: {
align: 'left',
x: -100,
y: 0
},
tickLength: 500,
plotLines: [{
color: 'red', // Color value
dashStyle: 'longdashdot', // Style of the plot line. Default to solid
value: 40000, // Value of where the line will appear
width: 1 // Width of the line
}]
},
legend: {
align: 'right',
verticalAlign: 'top',
y: 70,
layout: 'vertical'
},
series: [{
type:'area',
name: 'Low Impact',
data: [43000, 19000, 60000, 35000, 17000],
pointPlacement: 'off'
}, {
type:'area',
name: 'Actual Spending',
data: [50000, 39000, 42000, 31000, 26000],
pointPlacement: 'off'
}]
}
This demo shows how to find labels (SVG elements) in the chart object and create additional gridline using SVG Renderer: http://jsfiddle.net/kkulig/eg7p3r48/
events: {
render: function() {
var yAxis = this.yAxis[0],
renderer = this.renderer,
label = yAxis.ticks[0].label;
renderer.path(['M', label.xy.x, label.xy.y, 'l', label.xy.x - xOffset - 30, 0]).attr({
stroke: 'black',
'stroke-width': 1
}).add();
}
}
API reference: https://api.highcharts.com/class-reference/Highcharts.SVGRenderer#path

Is it possible to plot time series on top of a heat map in highcharts?

I have a highcharts heat map and would like to plot several line series / spline curves on top of the heat map. Is this possible?
You could have tried it quicker than you could have asked the question.
It works just fine, no need to overlaying plots or use other tricks. Just configure each series as the appropriate type:
series: [{
type: 'heatmap',
name: 'Sales per employee',
borderWidth: 1,
data: [[0,0,10],[0,1,19],[0,2,8],[0,3,24],[0,4,67],[1,0,92],[1,1,58],[1,2,78],[1,3,117],[1,4,48],[2,0,35],[2,1,15],[2,2,123],[2,3,64],[2,4,52],[3,0,72],[3,1,132],[3,2,114],[3,3,19],[3,4,16],[4,0,38],[4,1,5],[4,2,8],[4,3,117],[4,4,115],[5,0,88],[5,1,32],[5,2,12],[5,3,6],[5,4,120],[6,0,13],[6,1,44],[6,2,88],[6,3,98],[6,4,96],[7,0,31],[7,1,1],[7,2,82],[7,3,32],[7,4,30],[8,0,85],[8,1,97],[8,2,123],[8,3,64],[8,4,84],[9,0,47],[9,1,114],[9,2,31],[9,3,48],[9,4,91]],
dataLabels: {
enabled: true,
color: 'black',
style: {
textShadow: 'none',
HcTextStroke: null
}
}
},
{
type: 'line',
name: 'line',
data: [3, 2.67, 3, 1.33, 1.33, 3.2, 1.6, 2.5, 1.4, 0.2],
marker: {
lineWidth: 2,
lineColor: Highcharts.getOptions().colors[3],
fillColor: 'white'
},
},
{
type: 'spline',
name: 'spline',
data: [3.5, 1.67, 2, 0.33, 3.33, 1.2, 2.6, 0.5, 2.4, 1.2],
marker: {
lineWidth: 2,
lineColor: Highcharts.getOptions().colors[1],
fillColor: 'blue'
}
}]
Produces:
Fiddle here.
Sure, just use CSS positioning to overlay two charts, one being the heat map and one the lines. Obviously the top one will need to have the chart background color set to transparent.

Highcharts - Enable border for 1 column/bar only?

I have a bar chart and I would like to color one of the series white and enable a black border for this series only.
I'd rather not enable a border for everything. Is this possible?
I have a fiddle example - I was hoping it could be achieved in a similar way to the 'color' attribute of the series, but I can't see anything in the API;
series: [{
name: 'Measure',
data: [{
y: 10}, { y:9, color: 'white'}, { y: 8 }, { y: 7 }, { y: 7.2 }]
}]
http://jsfiddle.net/ZzXY2/
It turns out that 'borderColor' is an acceptable attribute of each of the data points, it's just not documented.
Turn the border on and set the default color to white:
plotOptions: {
bar: {
borderColor: '#FFFFFF',
borderWidth: 1
}
}
Set the border color within the appropriate series
series: [{
name: 'Measure',
data: [
{y: score2, color: colors[1], borderColor:'Yellow'},
{y: scoreprev, color: colors[4] },
{y: score1, color: colors[0] },
{y: score3, color: colors[2] },
{y: score4, color: colors[3] }] }]

Highstock : Shared tooltip except for one series

Concerning http://jsfiddle.net/5gjne/10/ I would like simply hide the "red" range series (range2) into tooltip, how to make this?
tooltip: {
crosshairs: true,
shared: true,
valueSuffix: '°C'
},
Thanks!
If you disable mouse tracking on that series it'll be excluded from tooltip.
{
name: 'Range',
data: ranges2,
type: 'arearange',
lineWidth: 0,
linkedTo: ':previous',
color: Highcharts.getOptions().colors[0],
fillOpacity: 0.3,
color: 'red',
zIndex: 0,
enableMouseTracking: false //<--add this
},
See updated fiddle.

Resources