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
- How to set multiple colors in one series in highchart
- highcharts-vue gives error about the highcharts HTML element
- mortgage calculator using highchart
- Highcharts loses it's dateRange values after refresh on IE<=9 and Chrome
- Drilldown United states city/county map from states using highcharter
- Highcharts series hover state enables after adding series
- Retrieving JSON data in highcharts
- How to proceed reactive function of dataset in Shiny - line chart R
- highcharts donut pie - different color for the data than its drilldown
- How to use ajax call to populate line graph in highcharts
- Display multiple points with exact same value in scatter HighCharts
- Highcharts data [x,y] written by golang
- How to add different click events on each pie of a pie chart created by highcharts usin jquery
- Highcharts : Custom legends in boxplot chart
- How to build chart in highchart.js where xAxis(miliseconds) and yAxis(days)?
- Android highchart how to disable export button?
- Highcharts change line style after intersect
- Highcharts: how to assign different colours to a spline depending on positive or negative slope?
- Display real time scale on xAxis
- how to make barchart from date 1 until 31 with different value?
- Links created in HighCharts are preventing their default bindings
- Converted PHP code that built an array to JS and now highcharts doesn't work - what did I do wrong?
- HighCharts (Stock) Styling Issues (Mobile and Date Selector)
- Handle touch event on Apple - Highcharts
- Anything other than 'bar' chart breaks highcharts.js
- HighCharts Dynamically Change Chart Type
- How to make a Highcharts semi-circle donut chart using Hightchart-ng
- Add plot line to heat map
- Highcharts chart going blank on zoomType: 'x' area range zoom?
- loading highcharts with data from database