Search code examples
javascriptjqueryhtmlamcharts

JS - where does this input-elemt come from (amCharts)?


I am messing around with amCharts and trying to connect a daterangepicker to a xy-linegraph. then I found this example:

http://jsfiddle.net/5aqL5pua/ but I dont understand something.. there is this section at the bottom

 chart.addListener('rendered', function (event) {
    $(".amcharts-start-date-input").datepicker({
        dateFormat: "MM/DD/YYYY",
        startDate: chart.startDate,
        endDate: chart.endDate
    }).on("changeDate", function (dpEvent) {
        chart.zoom(dpEvent.date, chart.endDate);
    });
});

where des this .amcharts-start-date-input-element come from? .. there is no html-element in the code?


Solution

  • If you look at the jsfiddle you'll see that some code is imported via CDN. The code targets <div id="chartdiv"></div> and attaches the div <div id="amcharts-stock-div"></div> around which it adds its own elements.

    https://en.wikipedia.org/wiki/Content_delivery_network