score:2
Accepted answer
In your modal code you need to make use of parent() instead of children in order to access the textControl.
And when deciding on the highCharts, you have to map it with second-chart as you already defined that one only and since there is no #container you need to have that in one which is in your markup
Here is a Working Fiddle
Code Snippet
$(function () {
var chart;
$('#second-chart').highcharts({
chart: {
type: 'bar'
},
subtitle: {
text: 'Assortment # by SKUs'
},
xAxis: {
categories: ['Lazada', 'C1', 'C2', 'C3']
},
yAxis: {
title: {
text: '# of SKUs'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
valueSuffix: ''
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
borderWidth: 0
},
series: [{
name: 'SKU',
data: [500, 120, 150, 300]
}]
});
$('#chart-modal').on('shown.bs.modal', function () {
var chart = $('#second-chart').highcharts();
var title_string = $(this).parent().find('.form-control').val().toString();
console.log(chart);
chart.setTitle({ text: title_string});
});
});
Source: stackoverflow.com
Related Query
- setting highcharts title in a modal
- Highcharts Drilldown Setting XAxis title differently
- Highcharts - setting the yAxis title dynamically
- How to let x axis title still show on the bottom when setting fontsize attribute in Highcharts
- Programmatically change a chart title in highcharts
- Change HighCharts axis title
- Highcharts won't fit in Bootstrap 3 modal body
- Change title when drilldown in Highcharts
- Javascript Highcharts v3.0.5 - How to hide Y Axis Title when using multiple Y Axis
- Highcharts Pie Chart ignores percentageDecimals tooltip setting and has floating point inaccuracy issue
- Highcharts - how to properly update series[0].data and yAxis title of a VUMeter?
- highcharts : set title on exporting
- How to add image in Highcharts Title and subtitle
- display content on highcharts Xaxis and Yaxis title in form of subscript and superscript
- Highcharts Legend Title Horizontal Align
- Change HighCharts axis title in 2.1.4
- Highcharts -- exporting, setting dataLabel options
- Open Highcharts in modal window
- Setting Highcharts maximum Y value to an exact amount without rounding
- Highcharts - Position title under chart
- Issue Dynamically Changing HighCharts Chart Title
- Color contrast setting on dataLabels style parameter using Highcharts 5 is not working on some colors
- Truncating Y-Axis Title in Highcharts v4.1.5
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- Highcharts - Bar - Setting the X axis width and the chart area width to be constant
- Setting Highcharts x axis label's width
- Highcharts - Global configuration with common code and unique data & Headings
- HighStock HighCharts Setting Flag on Click Event
- Highcharts exporting.js change menu hover title text
- How to center chart title position dynamically inside pie chart in highcharts
More Query from same tag
- Highcharts - series color on shadow
- Highcharts column tooltip - always on top + fit the container
- Highcharts - Issue with showing and hiding plot lines and bands on legendItemClick
- Highcharts dynamic height with table layout
- Using HighchartsExport Library for .Net I am getting Blank Page
- Async Drill-down not updating of HighCharts
- Highcharts - Removing title off tree maps
- Show/Update Separate Bar graphs with Drilldown Pie chart of Highcharts
- HighChart pie tooltip fixed
- how to draw a directed path on a map in highcharts?
- How to add and resize image in context button of highcharts
- How to apply highchart's license
- Own Tooltip highchart
- Drilldown in grouped column chart with categories
- Highcharts polar display custom label name or icons
- Highcharts - change color of only clicked column
- HighCharts - Set Max and Min values in zoom reset
- Unable to read JSON in PHP on FTP
- Loading variwide chart from Highcharts library in Angular 2+
- Where should I start learning Highcharts JS?
- Diplay name on highstock column
- How to make a function call every few seconds in c#?
- How can I customize a Highchart filename?
- R different colours for set of bars in barchart
- How to save a plot as image on disk from Viewer in RStudio?
- Highcharts - Selection Event Modify Options
- Highcharts Legend Selection double fires in Android WebView
- HighCharts - set minimum Tick Interval
- react-highcharts vs highcharts
- Highstock chart not loading with sample data