1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
private void ChartTemperatureMethod(Chart _Chart) { List<string> xData = new List<string>() {"0", "4:00", "8:00", "12:00", "16:00", "20:00", "24:00" }; List<int> yData = new List<int>() { 0,21, 35, 48, 40, 27, 7 }; List<int> yData1 = new List<int>() { 0,5, 18, 25, 68, 50, 30 }; string iss = "#VALX"; chart1.Series["Series1"].ToolTip = "时间:#VALX\nPM2.5:#VALYug/m^3\tPM10:" + yData1[xData.IndexOf("#VALX") + 1] + "ug/m^3"; chart1.Series["Series1"]["PieLabelStyle"] = "Outside"; chart1.Series["Series1"].Points.DataBindXY(xData, yData);
chart1.Series["Series2"].ToolTip = "时间:#VALX\nPM2.5:" + yData[xData.IndexOf("#VALX") + 1] + "ug/m^3\tPM10:#VALYug/m^3"; chart1.Series["Series2"]["PieLabelStyle"] = "Outside"; chart1.Series["Series2"].Points.DataBindXY(xData, yData1); }
|