score:2
Accepted answer
I have created a demo fiddle to dynamically change y-axis title. Refer this JSFIDDLE
HTML:
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
<input type="button" value="Change Y-axis Title to 'My text'" id="my_btn">
JS (part of thec code to update the y-axis title on a button click):
var chart = $('#container').highcharts();
$('#my_btn').click(function(){
//alert('hey');
chart.yAxis[0].update({
title:{
text:"My text"
}
});
alert('Y-axis title changed to "My text" !');
});
Refer Highcharts 'update' function documentation for further details.
score:0
You have two options:
- use
axis.setTitle()
- good performance, I advice use that solution for setting title - use
axis.update()
- lower performance, because it recreates whole axis, while first method only changes title
Source: stackoverflow.com
Related Query
- Highcharts: Dynamically (programmatically) assign the axis name
- Changing the name for 'categories' of x axis while implementing crossfilter with highcharts
- HighCharts Hide Series Name from the Legend
- how to set the interval of points on Y - Axis highcharts
- How replicate the value of Y Axis on both sides of the axis in Highcharts
- How can I change the unit at y axis dynamically at Highcharts?
- Changing the color of the point dynamically in highcharts
- Highcharts - get visible series name dynamically
- Align y axis tick "outside" on highstock, so they are the same as on highcharts
- Getting the X Axis value in HighCharts
- Highcharts - Bar - Setting the X axis width and the chart area width to be constant
- Get name of clicked point in Highcharts when the point has drilldown
- rendering Highcharts datatimes on the x axis at regular intervals
- Highcharts - programmatically "flip" (reverse) Y Axis
- Get axis name in tooltip on Highcharts
- Highcharts Gantt (JS) - Remove the day in x axis
- HighCharts - Show categories in x axis intead of the value of x in Bubble Chart
- HighCharts - Dynamically Change Axis Title Color
- How To Dynamically Truncate The Y-Axis Title On Chart Resize/Reflow In Highcharts
- How do I put Icons in the y Axis for a Dynamic Highcharts chart?
- Remove the Z Axis Column Line in Highcharts 3D
- Highcharts - how to create multiple y axis and group the data series
- how to display 2 same highcharts without duplicate the code
- Add data dynamically to the top level in highcharts when drilling up
- Highcharts - Series tooltip doesn't work when plotting lines that zigzag on the x axis
- Highcharts shown in multiple divs with the same name
- How do I dynamically change the yAxis min, max and tickInterval in HighCharts
- Get the x axis range on selecting a zoom range in Highcharts
- Is it possible to have two Y Axis in a highstock chart from highcharts one on the left and another on the right?
- Highcharts X axis categories name gets only shows 1 character
More Query from same tag
- series name and data for highcharts assigned via loop
- HightCharts : area range and spline in the same graph issue
- Highchart Legend's Border
- HighCharts - Show tooltip on column where value is 0 or null
- Change Colors and Using Setting Up an API
- How to build chart in highchart.js where xAxis(miliseconds) and yAxis(days)?
- Position dataLabel above a certain column Highcharts
- How can I change granularity in highcharts?
- Highchart treemap legends do not show specific legend
- HighCharts - problems with tickInterval and tickAmount
- Highcharts Treemap, drillup event
- How to add custom map and custom data to Highmaps?
- Heatmap: Get related data of the hovered cell on mouseOver
- Highcharts full circle gauge as in Knob js
- How can add fade In() effect to each appearance of a div when the mouse click?
- How to make the highcharts generated chart be scalable or responsive
- Radar Chart: Label outside the chart
- Reserve space for text in exported Highchart
- How to change the axis of Dual axes Graph
- Render bar chart
- Python: How to transform DF into Json series?
- how to remove scroll bar in drill down highchart
- Highcharts mulitple y axis unit not display
- SCRIPT87: Invalid argument In IE8 Using HighCharts v3.0.5
- Activity gauge High Chart with Range option
- Highcharts - how do I position categories aligned with tick marks as separations between columns?
- Highcharts doesnt work on pagination next page
- how to display 2 same highcharts without duplicate the code
- PieChart (HighCharts) Data and Labels
- Highstock + angular material + flex-layout problems