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

myapp.ChartLabels.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.ChartLabels.ChartType_render = function (element, contentItem) {
    $("<select><option>Column</option><option>Bar</option><option>Scatter</option><option>Line</option><option>LineSymbols</option><option>Area</option><option>Spline</option><option>SplineSymbols</option><option>SplineArea</option></select>")
    .appendTo($(element))
    .change(function () {
        myapp.chart.chartType = $(this).val();
    });
};
myapp.ChartLabels.DataLabelPosition_render = function (element, contentItem) {
    $("<select><option>Bottom</option><option>Center</option><option>Left</option><option>None</option><option>Right</option><option selected>Top</option></select>")
    .appendTo($(element))
    .change(function () {
        myapp.chart.dataLabel.position = $(this).val();
    });
};
myapp.ChartLabels.DataLabelBorder_render = function (element, contentItem) {
    $("<select><option>False</option><option>True</option></select>")
    .appendTo($(element))
    .change(function () {
        myapp.chart.dataLabel.border = $(this).val() === "True";
    });
};