score:1
You can do something like this.
$(function() {
var chart;
var d = 1;
var index = 0;
function getYValue(chartObj, seriesIndex, xValue) {
var yValue = null;
var points = chartObj.series[seriesIndex].points;
for (var i = 0; i < points.length; i++) {
if(i == points.length - 1 && points[i].x != xValue){
return 0;
}
yValue = points[i].y;
}
return yValue;
}
$('#b').click(function() {
//var newValue = series[0].data[0];
//chart.series[0].points[0].update(100);
chart.series[0].addPoint(0, false, false, false);
chart.redraw(false);
chart.series[0].points[chart.series[0].points.length - 1].update(1);
/*
console.log(index);
var d = getYValue(chart, index, 20.5);
console.log(d);
d++;
console.log(d);
chart.addSeries({
grouping: false,
data: [
[20.5, d]
]
});
index ++;
*/
})
chart = new Highcharts.Chart({
chart: {
type: 'column',
renderTo: 'container'
},
title: {
text: ''
},
xAxis: {
min: 0,
//max: 10
},
credits: {
enabled: false
},
series: [{
name: '',
data: [5, 3, 4, 7, 2]
}]
});
});
You can see the demo here.
Source: stackoverflow.com
Related Query
- Highchart: in bar chart, how to increment a bar according to data?
- How can I prevent my HighChart bar chart from being inverted?
- How to create chart with highchart in which bar doesn't start from 0 in y axis?
- HighChart Data label issue in bar chart
- how to show data json to 2 different highchart bar
- How can i load external json data in highcharts to show the bar chart
- How to add the "isSum" bar in Highchart Waterfall chart in R?
- How to make pie chart with data border radius in highchart
- How to display custom data on mouseover of column chart in highchart in addition to series data?
- How to add comma to data labels value in bar chart race of highcarts?
- how to get tow series data in highchart guage chart
- How to combine Bar chart and data as table in High Charts
- how to adjust distance between to bars in bar chart highchart
- How to render Gantt Highchart from data source
- How can I put text within horizontal bar chart data points using Highcharts as well as adding text underneath each data point? Example below:
- Trying to figure out how to assign specific colors to specific data points in Highchart Pie chart
- Highchart bar chart handle over lapping data lables for series
- How to open new chart to the adjacent <div> on bar click in highchart
- how to pass multi sereis data with dual y axis chart in highchart
- How do I hide the code for the chart data in highcharts?
- how to hide highchart x - axis data values
- How do I rotate my HighCharts bar chart so its vertical, not horizontal?
- How to export a Highchart chart to PDF thanks to a button outside the chart?
- Reduce gap between series data in Bar Highchart
- How to create a new Highstock chart with new Highchart and not jquery?
- How to add a plotline to a bar chart in Highcharts?
- How to display highchart y axis with constistant data
- Can color of data label be different inside and outside of the bar in Highchart
- How to apply borderRadius only for top side of Column or Bar in Highchart
- How to know information about the clicked bar in highchart column r shiny plot
More Query from same tag
- Content must fill available space down to footer and highchart must be reponsive (no scrolling allowed)
- Highchart generate array series
- Highcharts - Remove gap between tooltip border and content
- Color plots depending of value
- Angular 9 Highcharts - when using series of type pie with type gauge the innerSize of pie is not working
- Highcharts column + line combination chart with multiple series. Issue aligning line over the column
- Highstock chart export as PDF with image and text in title
- If series data array is null show message no data available
- Show TIME instead of DATE in Timeline Highcharts
- Unable to customize the box to short single line in 'boxplot' type Highcharts
- Adding additional information to Highstock point
- How to disable the on-hover color change in Highcharts?
- python generate histogram/pareto chart on keywords
- HighCharts xAxis show on 0 line with tick marks between all columns
- Remove underline for Drilldown labels
- highcharts piechart - small number of colors
- angular.js using highcharts-ng not maintaining series order, unless I force $apply (which throws already in progress error)
- How do I display the Y axis on top of the X?
- Highcharts 3D Pie Chart - angles live update
- Highcharts: Add a button on the chart to hide or show multiple axes
- Javascript or other charting library for geodata
- Hide all other series except selected series. Also display the list of items in dropdown
- How to add space between chart and axis in highcharts
- Is there a possibility to display regions in a detailed map (instead of cities)?
- Why my polar chart is rendered as a line chart? (Highcharts latest version)
- Highcharts, highlight point, without using click event?
- Blank Datas in highcharts using Codeigniter and highcharts
- vmware-clarity Type 'ElementRef' is not generic
- Nested json in Highcharts Stacked
- HighCharts Angular - Setting chart data from API