score:6
So after a few hours of digging, I have just found out the culprit (or I really hope so). The problem is your definition of yAxis
label formatter:
yAxis: {
tickInterval: 1,
gridLineWidth: 1,
labels: {
formatter: function() { // THIS IS THE PROBLEM
if (tasks[this.value]) {
return tasks[this.value].name;
}
}
},
startOnTick: false,
endOnTick: false,
title: {
text: 'Task'
}
},
You don't actually check if you should display the label according to task.intervals
(see json.js
). A simple update (Plunker) of the formatter seems to work:
yAxis: {
tickInterval: 1,
gridLineWidth: 1,
labels: {
formatter: function () {
console.log("scripts.js - yAxis.labels.formatter", this.value);
if (tasks[this.value]) {
//if (tasks[this.value].name === 'LILLY_C') {
var _xAxis = this.chart.axes[0];
var _task = tasks[this.value];
var _show = false;
// Not optimized for large collections
for (var _i = 0; _i < _task.intervals.length; _i++) {
var _int = _task.intervals[_i];
if (_xAxis.min <= _int.to) {
_show = true;
}
}
console.log("scripts.js - yAxis.labels.formatter",
tasks[this.value].name,
_show,
_xAxis.min,
_xAxis.max,
_task.intervals
);
if (_show) {
return tasks[this.value].name;
} else {
return;
}
//}
//return tasks[this.value].name;
}
}
},
startOnTick: false,
endOnTick: false,
title: {
text: 'Task'
}
},
See Plunker for demo.
Meaning of the yAxis labels is: Show label if you see a run in the graph or if there is a run on the right of the graph. Please modify the condition
if (_xAxis.min <= _int.to) {
as you see fit.
Disclaimer: I don't use Highcharts, so this answer tries to explain the problem and not to suggest a Highcharts-way of solving the problem.
Lessons learned:
yaxis-plugin.js
is irrelevant to the problem.- Highstock.js is an open-source library (highstock.src.js). Any debugging is much easier if you debug original source code. Minified code adds unnecessary complexity and guessing. I have downloaded the library and added some
console.log()
to find out what is going on.
Source: stackoverflow.com
Related Query
- How to create a column range chart in Highcharts using range and navigator functions?
- High chart - Column Range Chart with Time range. How to get tooltip as Start and End time
- How to have first level as column chart and second level as Fixed placement columns in drill down highcharts
- How can I prepare a Group Stacked Bar Chart in Highcharts using multiple and different types of data?
- How to create a progressive pie chart using Highcharts
- Align second scatter series to the side similar to how column and bar charts do using HighCharts
- How to Create a Stacked Column Chart with Dynamic Series in Highcharts
- How to use trellis chart with stacked column in Angular 10 using Highcharts
- Highcharts create legend for waterwall and stack column chart
- How to display Day and Date in Highcharts Column Graph using PHP
- How to display legend in Highcharts Waterfall Chart and make the sum column of waterfall appear in multiple colors?
- Show Column and line chart together in drill down using highcharts
- How to get column chart in angular using highcharts using dynamic data
- Highcharts : How to align column chart and bubble chart vertically in the same series
- How to display the value instead of percentage in a pie chart using jquery Highcharts
- How do you increase the performance of highcharts chart creation and rendering
- HighCharts - How to create dynamic chart that exports EVERYTHING
- How to create a new Highstock chart with new Highchart and not jquery?
- Using html2canvas to render a highcharts chart to pdf doesn't work on IE and Firefox
- Using Highcharts and displaying a message over or on the chart when there is no data
- How to add space between chart and axis in highcharts
- How to create Chart Data using SQL query
- Highcharts - How can I remove starting and ending padding from area chart
- How get data name in Highcharts pie chart legend instead of "Slice" using array of values?
- How to create an inner circle pie chart in Highcharts
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- Highcharts (Highstock) how to manually set the navigator selected range
- Highcharts 3.0, area chart with stacked and unstacked series - how to fix?
- How can i create doughnut chart using oxyplot in xamarin.android?
- how to create donut chart using highcharts?
More Query from same tag
- highcharts fixed point width is not working when a series is hidden
- Add background box to y-axis in highcharts
- Programmatically set rangeSelector in Highcharts
- Convert hours and minute to millisecond using javascript or jQuery
- Highcharts screen fitting issue
- Drag legend out of Highchart
- Can't update highcharts data on button - var visibility or events handle issue
- How to create such pie chart/ donut chart in highchart?
- How to redraw SVG Rendered Text from Highcharts
- Highchart in long array group categories
- Highcharts Export Renderer Image - Only SVG visible
- Apply a linear gradient to a spline with HighCharts
- Aligning labels in highchart donut
- Highchart Hide/Remove Annotation buttons on export
- plotbands target one of the two panes
- Can I add my own property in 'this' of xAxis labels formatter function in High Charts?
- legend size in Highcharts under ruby on rails
- how to call button click event on click of slice of piechart using highchart
- When trying to display a chart using ChartIt, Error saying template does not exist arises
- How to set correct xAxis time data in Highcharts?
- X axis labels overlap tooltip in column chart in highcharts
- HighCharts dynamic high/low extreme markers
- How to enable marker on hover only for a range of points in highcharts
- How to make highcharts stacked bar chart start from a specific date
- Chartkick Datepicker/Range Selector - Possibility to choose dates to show data
- Converting Poloniex API Callback JSON into format suitable for Highcharts.Stockchart
- Highcharts add a serie that does not exist
- Can not export renderer text using highcharts/highstock when click range selector
- How to make scrollable plot area fill all chart's background area in highcharts?
- Render from/to areas in Highcharts line chart