﻿
function LoadFlash(type, stationName) {
$("#jcid").html("当前监测站点："+stationName);
  if (type == "1") {
        GetLineDate("todayTemp", "line", "", "", stationName);
    } else if (type == "2")
    { GetLineDate("todayPress", "line", "", "", stationName); }
    else if (type == "3") {
        GetLineDate("todayPrecipitation", "col", "", "", stationName);
    } else if (type == "4") {
        GetLineDate("todayWindVelocity", "line", "", "", stationName);
    } else if (type == "5") {
        GetLineDate("todayRelHumidity", "line", "", "", stationName);
    }
}

function GetLineDate(arrayVal, linetype, lineName, dw,stationName) {

    $.ajax({
        contentType: "application/json",
        url: "/ashx/StationDate.ashx",
        data: { type: arrayVal, stationName: stationName },        
        dataType: 'text',
        async: false,
        success: function (result) {
      
            setChart(linetype, result)
        },
        error: function () { alert("error"); }
    });
}

function setChart(chartSWF, xmlData) {
    var linetype = chartSWF;
    var yjwXml = xmlData;
    var chart1 = new FusionCharts(linetype == "line" ? "script/curreLine/FCF_Line.swf" : "script/curreLine/FCF_Column2D.swf", "chart1Id", "685", "135", "0", "0");
    chart1.setDataXML(yjwXml);
    chart1.render("chartDiv");
    $("#chartDiv").addClass("map_02").addClass("map_02");
}


