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});
    });

});

Related Query

More Query from same tag