Using linked series in one chart has bug in highcharts - highcharts

I am trying to use multiple series in one chart and linking the series.
Here is one example of JSfiddle:
http://jsfiddle.net/tRZz5/1/
{
name: 'Red',
id: 'red',
data: [{
x: 1392140700000,
y: 2
},
{
x: 1392140760000,
y: 2
},
{
x: 1392140820000,
y: 2
},
{
x: 1392141000000,
y: 2
},
{
x: 1392141060000,
y: 2
}],
color: 'red',
lineWidth: 20
},
{
name: 'Green',
id: 'green',
data: [{
x: 1392140880000,
y: 2
},
{
x: 1392140940000,
y: 2
}],
color: 'green',
linkedTo: 'red',
lineWidth: 20
},
{
name: 'Grey',
id: 'Grey',
data: [{
x: 1392140820000,
y: 2
},
{
x: 1392140880000,
y: 2
}],
color: 'grey',
linkedTo: 'red',
lineWidth: 20
}
This works totally fine.
But in the same code when I move Red series to the end while adding into array then it behaves differently and put total red color even if I have specified different color in between.
http://jsfiddle.net/tRZz5/2/
{
name: 'Green',
id: 'green',
data: [{
x: 1392140880000,
y: 2
},
{
x: 1392140940000,
y: 2
}],
color: 'green',
linkedTo: 'red',
lineWidth: 20
},
{
name: 'Grey',
id: 'Grey',
data: [{
x: 1392140820000,
y: 2
},
{
x: 1392140880000,
y: 2
}],
color: 'grey',
linkedTo: 'red',
lineWidth: 20
},
{
name: 'Red',
id: 'red',
data: [{
x: 1392140700000,
y: 2
},
{
x: 1392140760000,
y: 2
},
{
x: 1392140820000,
y: 2
},
{
x: 1392141000000,
y: 2
},
{
x: 1392141060000,
y: 2
}],
color: 'red',
lineWidth: 20
}
Here I just move red series from top to bottom nothing else and series is being painted totally red, I think it should same as previous series.

Related

Highcharts Solid Gauge - Incorrect gauge value

I'm using two series for a solid gauge and the fill amount is incorrect for one of the series. I've tried adjust the tickInterval, tickValue, min, max and it doesn't make a difference. Even if I set the value to 0 it's filled about over 50% of the way.
vm.ecoScoreData = {
options : {
credits: {
enabled: false
},
navigation: {
buttonOptions: {
enabled: false
}
},
chart: {
type: 'solidgauge',
backgroundColor: '#F9F9F9',
margin: [0, 0, 0, 0],
height: 340
},
title: null,
legend: {
align: 'center',
layout: 'vertical',
labelFormatter: function () {
return '<span class="gauge-legend-item">' + this.name + '</span><span class="series-value">' + $filter('number')(this.yData[0]) + '</span>';
},
useHTML: true,
x: -10,
y: -20,
itemMarginTop: 4,
itemMarginBottom: 4
},
pane: {
center: ['50%', '70%'],
size: '100%',
startAngle: -90,
endAngle: 90,
background: {
backgroundColor: '#305F2A',
innerRadius: '75%',
outerRadius: '100%',
shape: 'arc'
}
},
// the value axis
yAxis: {
minColor: '#74BC54',
maxColor: '#74BC54',
lineWidth: 0,
minorTickInterval: null,
tickAmount: 2,
title: {
text: 'Connected Vehicles',
y: 40
},
labels: {
enabled: false
}
},
plotOptions: {
solidgauge: {
dataLabels: {
y: -30,
borderWidth: 0,
useHTML: true
}
}
},
tooltip: {
enabled: false
}
},
series: [
{
name: 'Opt-In '+chartData.optInPercent+'%',
data: [{
name: 'Opt-In',
radius: 100,
innerRadius: 75,
y: chartData.optIn
}],
marker: {
symbol: 'square'
},
lineWidth: 0,
showInLegend: true,
events: {
legendItemClick: function() {
return false;
}
},
dataLabels: {
formatter: function() {
return'<div style="text-align:center"><span style="font-size:18px;color:#707070">'+$filter('number')(chartData.connectedVehicles)+'</span></div>';
}
}
},
{
name: 'Opt-Out '+chartData.optOutPercent+'%',
data: [{
name: 'Opt-Out',
radius: 100,
innerRadius: 75,
y: 0
}],
marker: {
symbol: 'square'
},
lineWidth: 0,
showInLegend: true,
events: {
legendItemClick: function() {
return false;
}
},
dataLabels: {
format: '<div style="text-align:center"><span style="font-size:18px;color:#707070">{point.y:,.0f}</span></div>'
}
}
]
};

Highchart - How do I create the attached image gauge within a semicircle pie chart

Semi Circle Pie With Triangle Gauge
How do I create the above semicircle pie chart with a triangle gauge at the top of the chart.
I have the speedometer gauge working, but it doesn't meet the needs.
Is there a way within the highchart api to use a triangle for the gauge, and not the speedometer?
Thanks
Here is the fiddle with the tweaked JSON.
https://jsfiddle.net/mschreiberjdi/nwb7vL62/
$(function() {
$('#container').highcharts({
chart: {
renderTo: 'container',
plotBackgroundColor: null,
plotBackgroundImage: null,
plotBorderWidth: 0,
plotShadow: false
},
title: {
text: '40%<br>Probability Of <br>Success',
align: 'center',
verticalAlign: 'bottom',
y: -145
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
pane: {
center: ['50%', '75%'],
size: '50%',
startAngle: -90,
endAngle: 90,
background: {
borderWidth: 0,
backgroundColor: 'none',
innerRadius: '60%',
outerRadius: '100%',
shape: 'arc'
}
},
yAxis: [{
lineWidth: 0,
min: 0,
max: 90,
minorTickLength: 0,
tickLength: 0,
tickWidth: 0,
labels: {
enabled: false
},
title: {
text: '', //'<div class="gaugeFooter">46% Rate</div>',
useHTML: true,
y: 80
},
/*plotBands: [{
from: 0,
to: 46,
color: 'pink',
innerRadius: '100%',
outerRadius: '0%'
},{
from: 46,
to: 90,
color: 'tan',
innerRadius: '100%',
outerRadius: '0%'
}],*/
pane: 0,
}],
plotOptions: {
pie: {
dataLabels: {
enabled: true,
distance: -50,
style: {
fontWeight: 'bold',
color: 'white',
textShadow: '0px 1px 2px black'
}
},
startAngle: -90,
endAngle: 90,
center: ['50%', '75%']
},
gauge: {
dataLabels: {
enabled: false
},
pivot: {
radius: 80,
borderWidth: 2,
borderColor: 'transparent',
backgroundColor: 'white'
},
dial: {
radius: '100%',
backgroundColor: 'gray',
borderColor: 'gray',
baseWidth: 140,
topWidth: 1,
baseLength: '10%', // of radius
rearLength: '10%'
}
}
},
series: [{
type: 'pie',
name: 'Browser share',
innerSize: '50%',
data: [
['Low', 25],
['Medium', 25],
['HIgh', 25]
]
}, {
type: 'gauge',
data: [40],
dial: {
rearLength: 0
}
}],
});
});

lineWidth on both sides of chart

When I create a chart, I can place a nice line on the right side of the chart like so:
yAxis: [{
height: '65%',
offset: 0,
lineWidth: 2
}, {
top: '75%',
height: '25%',
offset: 0,
lineWidth: 2
}]
I have been asked to add an additional line on the left of the chart, but I don't see a built-in way to do that in the API docs. Is there a way to do this?
One way could be to add y axes on left side that will be linkedTo main y axes.
Example: http://jsfiddle.net/86zm6cav/
yAxis: [{
labels: {
align: 'right',
x: -3
},
title: {
text: 'OHLC'
},
height: '60%',
lineWidth: 2
}, {
labels: {
align: 'right',
x: -3
},
title: {
text: 'Volume'
},
top: '65%',
height: '35%',
offset: 0,
lineWidth: 2
}, {
opposite: false,
height: '60%',
linkedTo: 0,
lineWidth: 2,
offset: 0,
labels: {
enabled: false
}
}, {
opposite: false,
top: '65%',
height: '35%',
linkedTo: 1,
lineWidth: 2,
offset: 0,
labels: {
enabled: false
}
}],
Other option is to use renderer and create a custom path(s).
API reference for renderer: http://api.highcharts.com/highcharts#Renderer.path

does Highstock support a right border for a panel (yAxis)?

does Highstock support a right border for a panel (yAxis)? Right now, i can draw only left, top and down border.
Attached an image to describe my question
You can add a couple more yAxis that aren't attached to a series.
yAxis: [{
labels: {
align: 'right',
x: -3
},
title: {
text: 'OHLC'
},
height: '60%',
lineWidth: 2,
opposite: false
}, {
labels: {
align: 'right',
x: -3
},
title: {
text: 'Volume'
},
top: '65%',
height: '35%',
offset: 0,
lineWidth: 2,
opposite: false
},{
height: '60%',
lineWidth: 2
}, {
top: '65%',
height: '35%',
offset: 0,
lineWidth: 2
}],
http://jsfiddle.net/blaird/6oy17bhu/

HighCharts: add dashed line

I've this HighCharts:
$('#container').highcharts({
chart: {
type: 'scatter'
},
title: {
text: 'Title'
},
plotOptions: {
scatter: {
dataLabels: {
enabled: true,
formatter: function() {
return this.point.value;
}
}
}
},
series: [
{
name: 'Points',
data: [
{ x: 10, y: 25, value: 96.1 },
{ x: 50, y: 25, value: 96.3 },
{ x: 10, y: 50, value: 96.0 },
{ x: 50, y: 50, value: 96.3 },
{ x: 90, y: 50, value: 96.4 },
{ x: 100, y: 50, value: 96.5 },
{ x: 10, y: 100, value: 96.1 },
{ x: 50, y: 100, value: 96.3 },
{ x: 100, y: 100, value: 96.6 }
]
}
]
});
I would like to mark the 90/100 point with a dashed line. How can I do that?
See my JSFiddle.
I would use scatter series with enabled line: http://jsfiddle.net/6x6s09d8/4/
{
data: [
[90, 20],
[90, 100],
[10, 100]
],
lineWidth: 2,
dashStyle: 'Dash',
lineColor: 'black',
type: 'scatter',
marker: {
enabled: false
},
showInLegend: false,
enableMouseTracking: false
}
Only limitation now is to set minPadding: 0 for both Axes.

Resources