<commit_before>$(document).ready(function () {
    loadETFFunds();
    //ajaxIndex();
});

function ajaxIndex() {
    var getUrl = '/person/etf-fund-analysis/ajax-index';
    var getData = {
        "params": $('#formSearch').serializeObject()
    };
    var method = 'get';
    var successFunc = function (result) {
        if (typeof result.data != "undefined") {
            $('#eft_fund_analysis_chart').highcharts({
                chart: {
                    zoomType: 'x'
                },
                title: {
                    text: 'ETF Fund Analysis'
                },
                subtitle: {
                    text: document.ontouchstart === undefined ?
                        '鼠标拖动可以进行缩放' : '手势操作进行缩放'
                },
                xAxis: {
                    type: 'datetime',
                    dateTimeLabelFormats: {
                        millisecond: '%H:%M:%S.%L',
                        second: '%H:%M:%S',
                        minute: '%H:%M',
                        hour: '%H:%M',
                        day: '%m-%d',
                        week: '%m-%d',
                        month: '%Y-%m',
                        year: '%Y'
                    }
                },
                yAxis: {
                    min: 0,
                    title: {
                        text: 'Net Value'
                    }
                },
                tooltip: {
                    tooltip: {
                        dateTimeLabelFormats: {
                            millisecond: '%H:%M:%S.%L',
                            second: '%H:%M:%S',
                            minute: '%H:%M',
                            hour: '%H:%M',
                            day: '%Y-%m-%d',
                            week: '%m-%d',
                            month: '%Y-%m',
                            year: '%Y'
                        }
                    }
                },
                plotOptions: {
                    area: {
                        fillColor: {
                            linearGradient: {
                                x1: 0,
                                y1: 0,
                                x2: 0,
                                y2: 1
                            },
                            stops: [
                                [0, Highcharts.getOptions().colors[0]],
                                [1, Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0).get('rgba')]
                            ]
                        },
                        marker: {
                            radius: 2
                        },
                        lineWidth: 1,
                        states: {
                            hover: {
                                lineWidth: 1
                            }
                        },
                        threshold: null
                    }
                },
                series: [
                    {
                        type: 'area',
                        name: 'Unit Net Value',
                        data: result.data.unitNetData
                    },
                    {
                        type: 'area',
                        name: 'Accum Net Value',
                        data: result.data.accumNetData
                    }
                ]
            });
            $('#startDate').val(result.searchData.startDate);
            $('#endDate').val(result.searchData.endDate);
        } else {
            alert(result.error.message);
        }
    };
    jAjaxWidget.additionFunc(getUrl, getData, successFunc, method);
}

$('#btn_search').on('click', function (event) {
    event.preventDefault();
    ajaxIndex();
});

function loadETFFunds() {
    var getUrl = '/person/etf-fund/get-fund-list';
    var getData = {
        "params": {}
    };
    var method = 'get';
    var successFunc = function (result) {
        if (typeof result.data != "undefined") {
            $('#fuid').empty().append('<option value="0">请选择ETF基金</option>');
            for (var i = 0; i < result.data.currentItemCount; i++) {
                $('#fuid').append($('<option>', {
                    value: result.data.items[i]['fuid'],
                    text: result.data.items[i]['name']
                }));
            }
        } else {
            alert(result.error.message);
        }
    };
    jAjaxWidget.additionFunc(getUrl, getData, successFunc, method);
}
/*  --------------------------------------------------------------------------------------------------------  */<commit_msg>+ update etf fund analysis js code<commit_after>$(document).ready(function () {
    loadETFFunds();
    //ajaxIndex();
});

function ajaxIndex() {
    var getUrl = '/person/etf-fund-analysis/ajax-index';
    var getData = {
        "params": $('#formSearch').serializeObject()
    };
    var method = 'get';
    var successFunc = function (result) {
        if (typeof result.data != "undefined") {
            $('#eft_fund_analysis_chart').highcharts({
                chart: {
                    zoomType: 'x',
                    type: 'area'
                },
                title: {
                    text: 'ETF Fund Analysis'
                },
                subtitle: {
                    text: document.ontouchstart === undefined ?
                        '鼠标拖动可以进行缩放' : '手势操作进行缩放'
                },
                xAxis: {
                    type: 'datetime',
                    dateTimeLabelFormats: {
                        millisecond: '%H:%M:%S.%L',
                        second: '%H:%M:%S',
                        minute: '%H:%M',
                        hour: '%H:%M',
                        day: '%m-%d',
                        week: '%m-%d',
                        month: '%Y-%m',
                        year: '%Y'
                    }
                },
                yAxis: {
                    min: 0,
                    title: {
                        text: 'Net Value'
                    }
                },
                tooltip: {
                    tooltip: {
                        dateTimeLabelFormats: {
                            millisecond: '%H:%M:%S.%L',
                            second: '%H:%M:%S',
                            minute: '%H:%M',
                            hour: '%H:%M',
                            day: '%Y-%m-%d',
                            week: '%m-%d',
                            month: '%Y-%m',
                            year: '%Y'
                        }
                    },
                    shared: true
                },
                plotOptions: {
                    area: {
                        fillColor: {
                            linearGradient: {
                                x1: 0,
                                y1: 0,
                                x2: 0,
                                y2: 1
                            },
                            stops: [
                                [0, Highcharts.getOptions().colors[0]],
                                [1, Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0).get('rgba')]
                            ]
                        },
                        marker: {
                            radius: 2
                        },
                        lineWidth: 1,
                        states: {
                            hover: {
                                lineWidth: 1
                            }
                        },
                        threshold: null
                    },
                    areaspline: {
                        fillOpacity: 0.5
                    }
                },
                series: [
                    {
                        name: 'Unit Net Value',
                        data: result.data.unitNetData
                    },
                    {
                        name: 'Accum Net Value',
                        data: result.data.accumNetData
                    }
                ]
            });
            $('#startDate').val(result.searchData.startDate);
            $('#endDate').val(result.searchData.endDate);
        } else {
            alert(result.error.message);
        }
    };
    jAjaxWidget.additionFunc(getUrl, getData, successFunc, method);
}

$('#btn_search').on('click', function (event) {
    event.preventDefault();
    ajaxIndex();
});

function loadETFFunds() {
    var getUrl = '/person/etf-fund/get-fund-list';
    var getData = {
        "params": {}
    };
    var method = 'get';
    var successFunc = function (result) {
        if (typeof result.data != "undefined") {
            $('#fuid').empty().append('<option value="0">请选择ETF基金</option>');
            for (var i = 0; i < result.data.currentItemCount; i++) {
                $('#fuid').append($('<option>', {
                    value: result.data.items[i]['fuid'],
                    text: result.data.items[i]['name']
                }));
            }
        } else {
            alert(result.error.message);
        }
    };
    jAjaxWidget.additionFunc(getUrl, getData, successFunc, method);
}
/*  --------------------------------------------------------------------------------------------------------  */
{'fraction_non_alphanumeric': 0.14436885865457294, 'fraction_numerical': 0.00431918799265738, 'mean_word_length': 0.7406502537117083, 'pattern_counts': {'":': 4, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2748939', 'n_tokens_mistral': 2299, 'n_tokens_neox': 2139, 'n_words': 371}