score:2
Accepted answer
Rather than plotting the height of the closest point, try plotting the average height of the points either side of your bar.
You can get even closer if you work out a linear best fit for your bar on the line between the points either side. Something like:
function getY(xVal,points) {
var higher = 0;
var lower=0;
for(var i=0;i<points.length;i++){
if (points[i][0] > xVal) {
higher=i;
lower=i-1;
break;
}
}
return points[lower][1] + ((points[higher][1]-points[lower][1])*(xVal-points[lower][0])/(points[higher][0]-points[lower][0]));
};
Source: stackoverflow.com
Related Query
- How to match columns height with spline in Highcharts
- How to scale Highcharts height on window resize with React
- Highcharts Angular - How to set chart width and height with percentages?
- How to have multiple highcharts with different series data in vuejs without repeating code
- Highcharts - how to display a chart with stacked and un-stacked columns side-by-side
- How to hide columns with no data in HighCharts
- Highcharts - how can a chart with multi pies change container height automatic?
- Highcharts - how to have a chart with dynamic height?
- Resize height with Highcharts
- How to use highcharts with angular 5?
- How to include highcharts with bower?
- how to import highcharts with webpack and babel
- How to prevent highcharts from shortening labels with ellipsis
- How to export the whole page or html content with Highcharts not just the chart?
- How To Use Epoch Time With Highcharts Series Data?
- How to get rangeSelector to work with HighCharts
- Highcharts : Chart with drilldown how to obtain click event of drill up button
- How to use highcharts with princeXML?
- Column width in Highcharts when combined with spline
- How to structure Angular with Highcharts and lots of dynamic data
- How can I configure the legend with a specific height in highstock?
- Splines with Grouped Columns highcharts
- Highcharts How to get decimal point values on y-axis with big numbers
- How do I use an Highcharts Solid Gauge in angular 6 with typescript?
- Highcharts 3.0, area chart with stacked and unstacked series - how to fix?
- Highcharts - Global configuration with common code and unique data & Headings
- how to install highcharts with bower
- How to display HighCharts with tables
- How to populate a Highcharts axis with string formatted data from a PHP array
- How to enable noData with highcharts and angular
More Query from same tag
- Highchart Polar chart - 4 nested circle with different series
- highcharts pass multiple values to tooltip
- Is it possible to put calculation inside plotbands using highcharts?
- highstock Plotbands to mark certain Daytimes on X Axis
- Angular Highcharts hideNoData not working dynamically
- Highcharts with 2 series and 2 compare dates
- Update High Charts every Minute?
- Highcharts: Not plotting correctly with Y-Axis label formatter
- change distance of x-axis labels from axis in highchart
- Is there a way to get the coordinates of a Segment that I draw on the HighCharts stockChart?
- How to make - - legend in 'areaspline' type high charts?
- High chart width issue
- Server-side rendering with Highcharts in C#
- Highcharts more than 2 x axies
- How do I remove the empty space beneath a solid gauge?
- How to do Drilldown in Piechart of Highchart?
- Two pies, one legend with unique items (merge legends)
- Dealing with pie chart label overlap [Highcharts]
- HighCharts Stock Chart error code 18
- How i set actual value of xAxis in tooltip of highcharts
- Highmaps Kentucky isn't highlighted when printing using US-All map
- HighCharts : Update a point when grouping data
- Categories changed incorrect after redraw
- NVDA arrows navigation only working with alt key in highcharts
- Add additional data to a Highcharts series for use in formatters
- Multiple highcharts charts dynamically created in angular2 on one page
- Set a maximum for data grouping in Highstock charts to prevent from grouping
- Highcharts - Highstock "inputEditDataFormat" breaking input
- highcharts - inconsistent number of yAxis gridlines
- How to add background colors to category groupings in Highcharts