/// <reference path="~/GeneratedArtifacts/viewModel.js" />
/// <reference path="../Scripts/wijmo.cba.js" />

myapp.ChartRangeSelector.FlexChart_render = function (element, contentItem) {
    var chart = new c1.cba.FlexChart($(element), contentItem);
    var collectionView = new c1.cba.LightSwitchCollectionView(contentItem);
    chart.wjControl.itemsSource = collectionView;
    myapp.chart = chart.wjControl;
};

myapp.ChartRangeSelector.FinanceDatas_render = function (element, contentItem) {
    var chart = new c1.cba.FlexChart($(element), contentItem);
    var collectionView = new c1.cba.LightSwitchCollectionView(contentItem);
    chart.wjControl.itemsSource = collectionView;
    chart.wjControl.extenders[0].rangeChanged.addHandler(function (range) {
        myapp.chart.axisX.min = range.min;
        myapp.chart.axisX.max = range.max;
        myapp.chart.refresh();
    });
};
