highstock chart doesn't draw line continuations when connectNulls is true - javascript

I have configured a chart to use connectNulls.
What I am expecting is that the chart will draw lines to and from the edges of the chart:
(x=0 and x=n)
How do I get the chart to draw lines from the left edge (for the missing data points) to the right edge.
var chart = new Highcharts.StockChart({
chart: {
renderTo: 'container'
},
title: {
text: 'Connect Nulls'
},
plotOptions: {
series: {
connectNulls: true,
}
},
series: [
{
type: 'line',
name: data()[0][0],
data: data()[0][1]
},
}
http://jsfiddle.net/0qzrbnks/
edit
I have added a null value to series D0806, and it's still not connecting it?

Related

pie chart inside donut chart using chart js

I use chart js to draw pretty charts for my project. Now I need to draw pie chart inside donut chart like this:
Data in donut chart doesn't depending on data in pie chart that inside. Color also doesn't matter. Does anyone have ideas?
I can only draw pie chart and donut chart separately))
function drawOperatorStatusChart(labels, data, title, colors) {
new Chart(document.getElementById("pie_chart_operator"), {
type: 'pie',
data: {
labels: labels,
datasets: [{
label: data,
backgroundColor: colors,
data: data
}]
},
options: {
tooltips: {
callbacks: {
label: function (tooltipItem, data) {
return secondsToHHMMSS(data['datasets'][0]['data'][tooltipItem['index']]);
}
}
},
title: {
display: true,
text: title
}
}
});
}
function drawReportDetailedDoughnutChart(labels, data, title, colors) {
var ctx = document.getElementById('operator_detailed_doughnut_chart').getContext('2d');
new Chart(ctx, {
type: 'doughnut',
data: {
labels: labels,
datasets: [{
label: "",
backgroundColor: colors,
data: data
}]
},
options: {
responsive: true,
legend: {
position: 'top',
},
title: {
display: true,
text: title
},
animation: {
animateScale: true,
animateRotate: true
}
}
});
}
I would experiment with position absolute.
See a sample of my idea: http://jsfiddle.net/zteak2uq/
<canvas class="absolute" id="standChart"></canvas>

Is there limit on the number of data points to plot HighChart

I am using HighChart to plot Graph of the Telemetry data saved in cloud
Data Points on X-Axis is : Time
Data Points on Y-Axis is : Value
My Issue:
When the data requested is huge say >9000, HighChart errs out and doesn't plot the graph. (Note : I haven't checked the count limit , Hight Chart is able to plot- but when the number is smaller it always plots the graph)
What is the limit of data
Is there any limit of data to plot the graph?
Or is it that I have missed out something that handles this.
Please suggest a way to solve this issue.
The graph used to plot Chart in my app is
var chart_PT1 = new Highcharts.Chart({
chart: {
renderTo: 'signal_high_container'//'PT_1_high_container',
},
title: {
text: 'IO Signal Data'
},
subtitle: {
text: 'Source: GPS Modem'
},
yAxis: {
title: {
text: 'Value'
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle'
},
xAxis: {
type: 'datetime',
//categories: dddDate,
labels: {
enabled: true,
formatter: function () { return ddd[this.value][0]; },//<===== throw error here
}
},
series: [{
data: ddd,
name: SignalName
}]
});
});
It throws an exception in formatter at ddd[this.value][0] saying something like the index for ddd[this.value] not valid
xAxis: {
....
formatter: function () { return ddd[this.value][0]; },//<===== throw error here
Newer versions of highcharts have a turboThreshold option under plot options that places restrictions on data > 1000 plots. Look-up 'turboThreshold' in the docs for a better explanation.
Ref: https://api.highcharts.com/highcharts/plotOptions.series.turboThreshold

How to avoid overlapping of dataLabels in highchart pie chart?

I am using highcharts for rendering pie chart,
when series data is small/less, dataLabels are overlapping.
Link to reproduced problem.
http://jsfiddle.net/venkatesh1453/nwg2rdze/1/
plotOptions: {
pie: {
dataLabels: {
distance : function(){
return (-30 - (this.series.index *3));
}
}
}
},
I tried this code, but it moves all labels to right-top corner.
Please provide solution/workaround for avoiding labels overlapping.
The easiest way is move data labels outside of pie chart.
$(function () {
$('#container').highcharts({
chart: {
type: 'pie'
},
series: [{
data: [
['Firefox', 44.2],
['IE7', 26.6],
['IE6', 20],
['Chrome browser', 1.1],
['Other browsers', 1.4]
]
}]
});
});
Example

Highcharts - Area between two y values highlighted

I have a situation where I need to predict a trend in a time series, and I have to display confidence intervals. Is there a way to plot two sets of y-values in Highcharts as linked, and shade the area between the two? Something like this:
http://www.psychosomaticmedicine.org/content/74/4/377/F2.large.jpg
I have five time series: the prediction, two time series that bound the narrower confidence interval, and two more time series that bound the wider confidence interval.
The new Beta has that feature:
see jsFiddle
You can read more about the upcoming features in this post.
Highcharts does not natively support range charts (as of version 2.2.5), but there is a workaround. You can stack two area series on top of each other, with the foremost series having a background color matching that of the chart background.
And here is example javascript (that results in this chart):
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
defaultSeriesType: 'area'
},
title: {
text: 'Range chart emulation'
},
xAxis: {
},
yAxis: {
},
plotOptions: {
area: {
pointStart: 1940,
marker: {
enabled: false,
symbol: 'circle',
radius: 2,
states: {
hover: {
enabled: true
}
}
},
lineWidth: 0,
stacking: 'normal'
}
},
series: [{
// this series defines the height of the range
name: 'Range',
data: [1,2,3,5,7,8,9,6,4,7,5,3,4,7,6,5,6,7,5,4,2]
}, {
// this series defines the bottom values
name: 'Dummy',
data: [0,1,2,3,3.5,7,8.5,5,2.5,5.5,3,2,3,5.5,4,3,4,5.5,4,3.5,1.5],
enableMouseTracking: false,
showInLegend: false,
fillColor: 'rgba(255, 255, 255, 0)'
}]
});
});

Highcharts: How to rename series

I'm using highcharts in my web application and I was wondering if there's any way to rename a series after the chart hast been created??
Thanks in advance!!
actually, there's a way now. In highchars 3.0 series added a new api, called update:
chart.series[0].update({name:"name u want to change"}, false);
chart.redraw();
it will not only update the series name below the chart, but the name in tooltip as well.
Cheers!
This seems to work :
chart.series[1].name="Renamed";
chart.redraw();
There is no method for doing this in the API. You could remove the series and add it again with another name, but that will make the animations run a second time and I think it will be colored with a new color as well.
It is not required to Redraw chart again
We can include it along with the series option in the Chart declaration as below:
var chart = new Highcharts.Chart({
chart: {
renderTo: 'high_container'
},title: {
text: 'IO Signal Data'
},subtitle: {
text: 'Source: GPS Modem'
},
yAxis: {
title: {
text: 'Value'
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle'
},
xAxis: {
type: 'datetime',
labels: {
enabled: true,
formatter: function () { return ddd[this.value][0]; }, //<=== the value to plot chart
}
},
series: [{
data: ddd,
name: SeriesName
}]
});
You can use the following to change the series name:
$(chart.series[0].legendItem.element).children('tspan').text('newLabelName');

Categories

Resources