Question about highcharts plotOptions.series.states.select.lineWidthPlus - highcharts

I am implementing a chart with highcharts based on vue.js.
LineWidthPlus function works well on hover, but lineWidthPlus does not work on select.
This is part of my code.
plotOptions = {
series: {
lineWidth: 2,
boostThreshold: 1,
allowPointSelect: true,
stickyTracking: false,
states: {
hover: {
enabled: false,
},
select: {
enabled: true,
lineWidthPlus: 10,
},
},
}
What is the cause and if there is a demo, please tell me the demo url. thank you.

Related

remove xAxis label of vertical crosshair in highchart highstock

i have a highstock chart with multiple series, each one has it's own tooltip(shared:false), after hovering mouse, a label appear on xAxis, how to get ride of it?
{
xAxis: {
crosshair: false
},
tooltip: {
useHTML: true,
shadow: false,
borderRadius: 0,
borderColor: "transparent",
backgroundColor: "transparent",
borderWidth: 0,
},
plotOptions: {
series: {
turboThreshold: 0,
},
states: {
hover: {
enabled: false,
},
},
},
series: [ {
type: "line",
name: series[0].name,
data: [...],
color: series[0].color,
tooltip: {
pointFormatter() {
return `<span>tooltip1:xxx</span>`;
},
},
},
{
type: "line",
data: [...],
name: series[1].name,
color: series[1].color,
pointFormatter() {
return `<span>tooltip1:xxx</span>`;
},
}],
}
in here i put a sample of what i mean and a picture:
js fiddle
From Highcharts API:
split: boolean Since 5.0.0
Split the tooltip into one label per series, with the header close to
the axis. This is recommended over shared tooltips for charts with
multiple line series, generally making them easier to read. This
option takes precedence over tooltip.shared.
To get rid of the header set headerFormat to an empty string.
tooltip: {
headerFormat: ''
}
Live demo: https://jsfiddle.net/BlackLabel/bc467dmo/
API Reference: https://api.highcharts.com/highstock/tooltip.headerFormat

Initialize Highcharts treemap at specific drilldown level

Using this fiddle as an example.
I cannot find a way to default to a certain level and selection: in the linked example, if I wanted to start drilled-down into South-East Asia, how could I do so? (as if I had clicked South-East Asia once it loaded)
Highcharts.chart('container', {
series: [{
type: 'treemap',
layoutAlgorithm: 'squarified',
allowDrillToNode: true,
animationLimit: 1000,
dataLabels: {
enabled: false
},
levelIsConstant: false,
levels: [{
level: 1,
dataLabels: {
enabled: true
},
borderWidth: 3
}],
data: points
}]
});
As I understood - you would like to trigger a drilldown event on the initial load, am I right? If yes, here is a demo with the example how to achieve it.
if (Highcharts.isString(drillId)) {
series.setRootNode(drillId, true, {
trigger: 'click'
});
}

Highcharts - degraded tooltip rendering performance

I'm using Highcharts in an Angular 8 application, and while the chart itself renders quite fast, I am encountering some seriously degraded performance rendering tooltips on charts bound to larger data sets. Interestingly the issue seems less related to the number of data points than to the amount of the plot area series fill.
We are using Boost (in app.module.ts):
Boost(Highcharts);
NoData(Highcharts);
More(Highcharts);
NoData(Highcharts);
theme(Highcharts);
and this is is the chart's config (series are added dynamically):
public baseChartOptions: Highcharts.Options = {
chart: {
type: 'line',
zoomType: 'x',
animation: false,
height: '55%'
},
boost: {
enabled: true,
useGPUTranslations: true,
usePreallocated: true
},
legend: {
enabled: true,
align: 'center',
verticalAlign: 'bottom',
layout: 'horizontal'
},
exporting: { enabled: false },
plotOptions: {
series: {
lineWidth: 1.5,
animation: false,
marker: {
enabled: false
}
}
},
xAxis: [
{
type: 'datetime',
dateTimeLabelFormats: {
day: '%m/%d'
}
} as Highcharts.XAxisOptions
],
yAxis: [
{
minorTickLength: 0,
tickLength: 0,
title: {
text: ''
}
}
],
tooltip: {
shared: true,
pointFormat: '<span style="color:{point.color}">\u25CF</span> {series.name}: <b>{point.y:.0f}</b><br/>',
animation: false
},
series: []
};
What are best practices for ensuring the best performance in rendering tooltips? I've seen the Highcharts demo showing over 1,000,000 points with good performance, but I don't seem to be able to achieve the same.
I've included a short video converted to gif that illustrates the behavior I'm seeing at three different data densities.
Thanks for your help!
highcharts tooltip performance
The performance should be better when you disable shared tooltip:
tooltip: {
animation: false,
valueDecimals: 2,
shared: false
}
Demo:
http://jsfiddle.net/BlackLabel/xhpqedrt/1/

How to use highstocks navigator on a highchart

I have a highcharts datetime spline graph, and I would like to add the navigator from highstocks (highstocks is already on the page) without changing anything else about the graph.
Switching from a highchart to highstocks also changes of lots of default behaviour which I'd like to forego (axis settings, legend settingsā€¦ all sorts). I just want the navigator.
So I'd either like to add just the navigator to my highchart, or be pointed to a comprehensive list of options that I can pass to highstocks to make it match the highcharts defaults (if one exists).
Thanks!
By replacing highcharts.js with highstock.js you won't change default behavior:
Highcharts: http://jsfiddle.net/pq7o66as/
Highstock: http://jsfiddle.net/pq7o66as/1/
Now simply enable navigator:
http://jsfiddle.net/pq7o66as/2/
navigator: {
enabled: true
},
Note:
Don't change constructor from: $('#container').highcharts(options); to $('#container').highcharts('StockChart', options);.
And default options for Highstock:
chart: {
panning: true,
pinchType: 'x',
inverted: false // "true" is not supported in Highstock
},
navigator: {
enabled: true
},
scrollbar: {
enabled: true
},
rangeSelector: {
enabled: true
},
title: {
text: null,
style: {
fontSize: '16px'
}
},
tooltip: {
shared: true,
crosshairs: true
},
legend: {
enabled: false
},
plotOptions: {
line: {
marker: {
enabled: false,
radius: 2
},
states: {
hover: {
lineWidth: 2
}
}
},
column: {
shadow: false,
borderWidth: 0
}
},
xAxis: {
startOnTick: false, // only when navigator enabled
endOnTick: false, // only when navigator enabled
minPadding: 0,
maxPadding: 0,
ordinal: true,
title: {
text: null
},
labels: {
overflow: 'justify'
},
showLastLabel: true,
type: 'datetime' // in Highstock only supported type
},
yAxis: {
labels: {
y: -2
},
opposite: opposite,
showLastLabel: false,
title: {
text: null
}
}

high charts - how do I get a stacked graph to the full width?

I have created a high chart but would like to have a similar voting style to youtube; with positive vs negative. My issue is getting the bar to stay the full width of the graph, I know percentages can fix this but I want whole numbers.
http://jsfiddle.net/u6H3b/
$(function () {
$('#container').highcharts({
chart: {
type: 'bar',
marginLeft:0
},
title: {
text: 'votes'
},
credits: {
enabled: false
},
xAxis: {
categories: ['Apples'],
title: {
enabled: false
}
},
exporting: {
enabled: false
},
yAxis: {
min: 0,
max:23,
title: {
enabled: false },
gridLineColor: '#fff',
lineColor: '#fff'
},
legend: {
backgroundColor: '#FFFFFF',
reversed: true
},
plotOptions: {
series: {
stacking: 'normal'
}
},
series: [{
name: 'Yes',
data: [20]
},{
name: 'No',
data: [3]
}]
});
});
One option is to use 'endOnTick':
yAxis: {
endOnTick: false,
http://jsfiddle.net/f3eFd/
If you want the end tick (23) to show, you could also add:
tickInterval:23,
http://jsfiddle.net/bLDpg/
If you really want to get fancy, you can define each tick you need. In the following code, it prints ticks at 0, 3 and at 23.
tickPositioner: function () {
var positions = [0, 3, 23];
return positions;
},
http://jsfiddle.net/aSHz3/
I think, all you need to set is endOnTick: false and maxPadding: 0, see: http://jsfiddle.net/u6H3b/1/
The only problem is that last tick is not displayed, if this is issue for you, use tickPositioner as suggested by SteveP.

Resources