EChart_ParticlesComposition.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  1. using DevExpress.Utils;
  2. using DevExpress.XtraCharts;
  3. using NPOI.Util;
  4. using OTSIncAReportApp.OTSRstMgrFunction;
  5. using OTSIncAReportApp.OTSSampleReportInfo;
  6. using OTSIncAReportApp.SysMgrTools;
  7. using OTSIncAReportGrids;
  8. using System;
  9. using System.Collections;
  10. using System.Collections.Generic;
  11. using System.Data;
  12. using System.Linq;
  13. using System.Windows.Forms;
  14. namespace OTSIncAReportApp.Control_ECharts
  15. {
  16. /// <summary>
  17. /// 各图char相关模块
  18. /// </summary>
  19. public partial class EChart_ParticlesComposition : UserControl
  20. {
  21. Hashtable table;
  22. #region 图表相关变量
  23. //y轴名称
  24. public string m_str_AxisY { get; set; }
  25. //数据图类型:常用夹杂物分类CommonlyUsedClassify ,颗粒成分PComponent,元素成分EComponent,颗粒尺寸分布PSize
  26. string ComSel { get; set; }
  27. public bool Report { get; set; }
  28. frmReportApp m_ReportApp;
  29. private frmReportConditionChoose m_conditionChoose;
  30. private ResultDataMgr m_DataMgr;
  31. private List<DataTable> prListData = new List<DataTable>();
  32. private List<string> prListString = new List<string>();
  33. #endregion
  34. #region 窗体加载及构造函数
  35. public EChart_ParticlesComposition(frmReportApp ReportApp, string comsel)
  36. {
  37. ComSel = comsel;
  38. m_ReportApp = ReportApp;
  39. m_conditionChoose = ReportApp.m_conditionChoose;
  40. m_DataMgr = ReportApp.m_rstDataMgr;
  41. InitializeComponent();
  42. //国际化
  43. Language lan = new Language();
  44. table = lan.GetNameTable("CompositionDistributionGrid");
  45. }
  46. private void EChart_ParticlesComposition_Load(object sender, EventArgs e)
  47. {
  48. string sou = "";
  49. int sel = 0;//选择颗粒范围(0为全部颗粒1为选择颗粒)
  50. if (Report)
  51. {
  52. sou = m_DataMgr.ResultFilesList[m_DataMgr.GetWorkingResultId()].anotherFileName.ToString();
  53. sel = 0;
  54. }
  55. else
  56. {
  57. sou = m_conditionChoose.m_conditionData.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
  58. sel = m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
  59. }
  60. Report = false;
  61. if (m_ReportApp.more)
  62. {
  63. m_ReportApp.trans = false;
  64. }
  65. else
  66. {
  67. m_ReportApp.trans = true;
  68. }
  69. m_ReportApp.more = true;
  70. List<DataTable> list_dt = GetListJsonStr();
  71. bool bl = false;
  72. for (int i=0;i< list_dt.Count;i++)
  73. {
  74. if (list_dt[i].Rows.Count>0)
  75. {
  76. bl = true;
  77. }
  78. }
  79. if(!bl)
  80. {
  81. checkButton1.Visible = false;
  82. checkButton2.Visible = false;
  83. checkButton3.Visible = false;
  84. return;
  85. }
  86. prListData = list_dt.Copy();
  87. prListString.Clear();
  88. for (int i = 0; i < list_dt.Count; i++)
  89. {
  90. ResultFile resultFile = m_DataMgr.ResultFilesList.Find(s => s.anotherFileName == sou.Split('+')[i]);
  91. string str = resultFile.anotherFileName;
  92. prListString.Add(str);
  93. // 假设你已经有一个 ChartControl 实例,并且已经添加了一个饼图 Series
  94. //string str = prListString[i];
  95. Series series = new Series(str, ViewType.Pie);
  96. for (int a = 0; a < prListData[i].Rows.Count; a++)
  97. {
  98. string name = prListData[i].Rows[a]["name"].ToString();
  99. double Cunt = Convert.ToDouble(prListData[i].Rows[a]["Cunt"]);
  100. series.Points.Add(new SeriesPoint(name, Cunt));
  101. }
  102. series.LabelsVisibility = DefaultBoolean.True;
  103. series.Label.TextPattern = "{A}";
  104. chartControl1.Series.Add(series);
  105. }
  106. chartControl1.Legend.Visibility = DefaultBoolean.False;
  107. chartControl1.Refresh();
  108. panel1.Dock = DockStyle.Fill;
  109. chartControl1.Dock = DockStyle.Fill;
  110. checkButton1.Checked = false;
  111. checkButton2.Checked = false;
  112. checkButton3.Checked = true;
  113. }
  114. #endregion
  115. #region 获取单数据源
  116. private DataTable ClassificationIntegration(string path, int sel)
  117. {
  118. //------------------加载模块,获取数据-------------------------------------------------
  119. ResultGrid ls_resultgrid = new ResultGrid(m_ReportApp);
  120. Dictionary<string, string> keyValues_ResultGrid = ls_resultgrid.GetData_ResultGrid_Report();
  121. //------------------加载模块,获取数据结束----------------------------------------------
  122. Dictionary<string, string>.Enumerator en = keyValues_ResultGrid.GetEnumerator();
  123. string str_SCZS = "";
  124. keyValues_ResultGrid.TryGetValue(ls_resultgrid.table["col5"].ToString(), out str_SCZS);//视场总数
  125. DataOperation.DataAccess.ParticleData particledata = new DataOperation.DataAccess.ParticleData(path);
  126. DataTable data = new DataTable();
  127. data = particledata.GetAreaByAllIncA("");//获取所有分类面积和数量信息
  128. if (data.Rows.Count == 0)
  129. {
  130. return data;
  131. }
  132. DataTable AreaInformationOfAllElements = ConSolidateInvalid(data);
  133. DataTable AllAnalysisDetails = new DataTable();
  134. AllAnalysisDetails.Columns.Add("Name");
  135. AllAnalysisDetails.Columns.Add("TypeId");
  136. AllAnalysisDetails.Columns.Add("Area", typeof(double));
  137. AllAnalysisDetails.Columns.Add("Class");
  138. AllAnalysisDetails.Columns.Add("Cunt", typeof(double));
  139. for (int i = 0; i < AreaInformationOfAllElements.Rows.Count; i++)
  140. {
  141. DataRow dr2 = AllAnalysisDetails.NewRow();
  142. dr2["Name"] = AreaInformationOfAllElements.Rows[i]["TypeName"].ToString();
  143. dr2["Area"] = Convert.ToDouble(AreaInformationOfAllElements.Rows[i]["ar"]);
  144. dr2["TypeId"] = AreaInformationOfAllElements.Rows[i]["TypeId"].ToString();
  145. dr2["Cunt"] = Convert.ToDouble(AreaInformationOfAllElements.Rows[i]["con"]);
  146. dr2["Class"] = AreaInformationOfAllElements.Rows[i]["GroupName"].ToString();
  147. AllAnalysisDetails.Rows.Add(dr2);
  148. }
  149. //按照list列表进行物质类排序,物质类中的元素分类按照面积的大小进行排序
  150. List<string> ClassName = new List<string>();
  151. DataTable getClass_dt = particledata.GetAllClass();
  152. for (int i = 0; i < getClass_dt.Rows.Count; i++)
  153. {
  154. ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
  155. }
  156. DataTable AreaRatio = new DataTable();
  157. AreaRatio.TableName = "InclusionAreaRatio";
  158. AreaRatio.Columns.Add("e1");
  159. AreaRatio.Columns.Add("e2");
  160. AreaRatio.Columns.Add("e3", typeof(double));
  161. AreaRatio.Columns.Add("e4");
  162. AreaRatio.Columns.Add("e5");
  163. AreaRatio.Columns.Add("Cunt", typeof(int));
  164. //获取夹杂物的总面积用于计算夹杂物类别的占比(gridview最后一个固定是未识别颗粒,要排除未识别颗粒所以for循环至grid view长度减一)
  165. double totalInclusionArea = 0;
  166. totalInclusionArea = Convert.ToDouble(decimal.Parse(AllAnalysisDetails.Compute("sum(Area)", "").ToString()));
  167. for (int i = 0; i < AllAnalysisDetails.Rows.Count; i++)
  168. {
  169. DataRow dr2 = AreaRatio.NewRow();
  170. dr2["e1"] = AllAnalysisDetails.Rows[i]["Class"].ToString();
  171. dr2["e2"] = AllAnalysisDetails.Rows[i]["Name"].ToString();
  172. dr2["e3"] = Convert.ToDouble(AllAnalysisDetails.Rows[i]["Area"]);
  173. dr2["e4"] = Math.Round((Convert.ToDouble(AllAnalysisDetails.Rows[i]["Area"]) / totalInclusionArea) * 100, 2);
  174. dr2["e5"] = Math.Round((Convert.ToDouble(AllAnalysisDetails.Rows[i]["Area"]) / Convert.ToDouble(str_SCZS)) * 100, 4);
  175. dr2["Cunt"] = AllAnalysisDetails.Rows[i]["Cunt"].ToString();
  176. AreaRatio.Rows.Add(dr2);
  177. }
  178. DataTable AreaRatio_dt = AreaRatio.Copy();
  179. AreaRatio_dt.Clear();
  180. for (int i = 0; i < ClassName.Count(); i++)
  181. {
  182. DataTable dt = AreaRatio.Copy();
  183. dt.Clear();
  184. for (int a = 0; a < AreaRatio.Rows.Count; a++)
  185. {
  186. if (AreaRatio.Rows[a]["e1"].ToString() == ClassName[i].ToString())
  187. {
  188. dt.Rows.Add(AreaRatio.Rows[a].ItemArray);
  189. }
  190. }
  191. DataView dv = dt.DefaultView;
  192. dv.Sort = "e3 DESC";
  193. DataTable dt_Element = dv.ToTable();
  194. for (int a = 0; a < dt_Element.Rows.Count; a++)
  195. {
  196. AreaRatio_dt.Rows.Add(dt_Element.Rows[a].ItemArray);
  197. }
  198. }
  199. DataTable AllAnalysisDetails1 = AreaRatio_dt.Copy();
  200. AllAnalysisDetails1.Clear();
  201. for (int i = 0; i < ClassName.Count; i++)
  202. {
  203. DataTable dt = AreaRatio_dt.Copy();
  204. dt.Clear();
  205. for (int a = 0; a < AreaRatio_dt.Rows.Count; a++)
  206. {
  207. if (AreaRatio_dt.Rows[a]["e1"].ToString() == ClassName[i].ToString())
  208. {
  209. dt.Rows.Add(AreaRatio_dt.Rows[a].ItemArray);
  210. }
  211. }
  212. if (dt.Rows.Count > 0)
  213. {
  214. double totalInclusionArea2 = Convert.ToDouble(decimal.Parse(AreaRatio_dt.Compute("sum(e3)", "").ToString()));
  215. double Area = Convert.ToDouble(decimal.Parse(dt.Compute("sum(e3)", "").ToString()));
  216. int cunt = Convert.ToInt32(decimal.Parse(dt.Compute("sum(Cunt)", "").ToString()));
  217. DataRow dr3 = AllAnalysisDetails1.NewRow();
  218. dr3["e1"] = ClassName[i].ToString();
  219. dr3["e3"] = Math.Round(Area, 2);
  220. dr3["e4"] = Math.Round((Convert.ToDouble(dt.Rows[0]["e3"]) / totalInclusionArea2) * 100, 2);
  221. dr3["e5"] = Math.Round((Convert.ToDouble(dt.Rows[0]["e3"]) / Convert.ToDouble(str_SCZS)) * 100, 4);
  222. dr3["Cunt"] = cunt;
  223. AllAnalysisDetails1.Rows.Add(dr3);
  224. }
  225. }
  226. return AllAnalysisDetails1;
  227. }
  228. private DataTable ConSolidateInvalid(DataTable dt)
  229. {
  230. DataTable dt_invalid = dt.Clone();
  231. DataTable dt_no_invalid = dt.Clone();
  232. for (int i = 0; i < dt.Rows.Count; i++)
  233. {
  234. if (dt.Rows[i]["TypeName"].ToString() == "Invalid")
  235. {
  236. dt_invalid.Rows.Add(dt.Rows[i].ItemArray);
  237. }
  238. else
  239. {
  240. dt_no_invalid.Rows.Add(dt.Rows[i].ItemArray);
  241. }
  242. }
  243. return dt_no_invalid;
  244. }
  245. private string getWhere(string max, string min, string col)
  246. {
  247. return col + ">=" + min + " and " + col + "<" + max;
  248. }
  249. #endregion
  250. #region echarts
  251. /// <summary>
  252. /// 通过m_list_chartstruct,组合json数据格式
  253. /// </summary>
  254. /// <returns></returns>
  255. private List<DataTable> GetListJsonStr()
  256. {
  257. int sel = m_conditionChoose.m_conditionData.ProItemProIndex();
  258. string filedAndParticl = "";
  259. DataOperation.DataAccess.ParticleData particledata = null;
  260. DataTable dt = new DataTable();
  261. List<DataTable> ListData = new List<DataTable>();
  262. string sou = m_conditionChoose.m_conditionData.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
  263. for (int i = 0; i < sou.Split('+').Length; i++)
  264. {
  265. ResultFile resultFile = m_DataMgr.ResultFilesList.Find(s => s.anotherFileName == sou.Split('+')[i]);
  266. if (resultFile == null)
  267. {
  268. continue;
  269. }
  270. particledata = new DataOperation.DataAccess.ParticleData(resultFile.FilePath);
  271. switch (ComSel)
  272. {
  273. case "InclusionareaRatio":
  274. dt = particledata.GetAreaByAllIncA("");
  275. DataTable dtInclusionareaRatio = new DataTable();
  276. dtInclusionareaRatio.Columns.Add("name");
  277. dtInclusionareaRatio.Columns.Add("Cunt");
  278. for (int k = 0; k < dt.Rows.Count; k++)
  279. {
  280. string str = dt.Rows[k]["ar"].ToString();
  281. string name = dt.Rows[k]["TypeName"].ToString();
  282. if (Convert.ToInt32(dt.Rows[k]["TypeId"]) < 100)
  283. {
  284. continue;
  285. }
  286. DataRow dr = dtInclusionareaRatio.NewRow();
  287. dr["name"] = name;
  288. dr["Cunt"] = decimal.Round(decimal.Parse(dt.Rows[k]["ar"].ToString()), 2).ToString();
  289. dtInclusionareaRatio.Rows.Add(dr);
  290. }
  291. ListData.Add(dtInclusionareaRatio);
  292. break;
  293. case "CommonlyUsedClassify":
  294. //计算分类整个表的数据
  295. dt = ClassificationIntegration(resultFile.FilePath, sel);
  296. DataTable data = new DataTable();
  297. data.Columns.Add("name");
  298. data.Columns.Add("Cunt");
  299. for (int a = 0; a < dt.Rows.Count; a++)
  300. {
  301. DataRow dr = data.NewRow();
  302. dr["name"] = dt.Rows[a]["e1"].ToString();
  303. dr["Cunt"] = dt.Rows[a]["Cunt"].ToString();
  304. data.Rows.Add(dr);
  305. }
  306. ListData.Add(data);
  307. break;
  308. case "PComponent":
  309. //创建新的图形数据源
  310. dt = particledata.GetParticleListByIncA("area");
  311. DataTable dtPComponent = new DataTable();
  312. dtPComponent.Columns.Add("name");
  313. dtPComponent.Columns.Add("Cunt");
  314. for (int a = 0; a < dt.Rows.Count; a++)
  315. {
  316. if (Convert.ToInt32(dt.Rows[a]["TypeId"]) < 100)
  317. {
  318. continue;
  319. }
  320. DataRow dr = dtPComponent.NewRow();
  321. dr["name"] = dt.Rows[a]["TypeName"].ToString();
  322. dr["Cunt"] = dt.Rows[a]["con"].ToString();
  323. dtPComponent.Rows.Add(dr);
  324. }
  325. ListData.Add(dtPComponent);
  326. break;
  327. case "EComponent":
  328. //创建新的图形数据源
  329. dt = particledata.GetElementForArea(filedAndParticl);
  330. DataTable dtEComponent = new DataTable();
  331. dtEComponent.Columns.Add("name");
  332. dtEComponent.Columns.Add("Cunt");
  333. for (int k = 0; k < dt.Rows.Count; k++)
  334. {
  335. string str = dt.Rows[k]["earea"].ToString();
  336. try
  337. {
  338. DataRow dr = dtEComponent.NewRow();
  339. dr["name"] = dt.Rows[k]["name"].ToString();
  340. dr["Cunt"] = decimal.Round(decimal.Parse(str), 2).ToString();
  341. dtEComponent.Rows.Add(dr);
  342. }
  343. catch
  344. {
  345. DataRow dr = dtEComponent.NewRow();
  346. dr["name"] = dt.Rows[k]["name"].ToString();
  347. dr["Cunt"] = str;
  348. dtEComponent.Rows.Add(dr);
  349. }
  350. }
  351. ListData.Add(dtEComponent);
  352. break;
  353. case "PSize":
  354. //获取粒级表
  355. string pathe = m_DataMgr.m_RptConfigFile.PartSizeFileFolder + m_DataMgr.m_RptConfigFile.PartSizeFile;
  356. DataSet ds = DataOperation.DataAccess.XMLoperate.GetXml(pathe);
  357. string sizestr = ds.Tables[0].Rows[0]["Sizes"].ToString();
  358. List<string> temp = new List<string>();
  359. for (int j = 0; j < sizestr.Split(',').Length - 1; j++)
  360. {
  361. if (sizestr.Split(',')[j].Length > 0)
  362. {
  363. double d1 = Convert.ToDouble(sizestr.Split(',')[j]);
  364. double d2 = Convert.ToDouble(sizestr.Split(',')[j + 1]);
  365. string name = d1.ToString() + "~" + d2.ToString();
  366. temp.Add(name);
  367. }
  368. }
  369. double d = Convert.ToDouble(sizestr.Split(',')[sizestr.Split(',').Length - 1]);
  370. string name1 = d.ToString() + "~MAX";
  371. temp.Add(name1);
  372. string con = m_conditionChoose.m_conditionData.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE).ToString();
  373. string po = "";
  374. switch (con)
  375. {
  376. case "DMAX":
  377. po = "DMAX";
  378. break;
  379. case "DMIN":
  380. po = "DMIN";
  381. break;
  382. case "ECD":
  383. po = "Area";
  384. break;
  385. case "FERET":
  386. po = "DFERET";
  387. break;
  388. }
  389. DataTable dtp = particledata.GetParticleAll(filedAndParticl);
  390. DataTable dtPSize = new DataTable();
  391. dtPSize.Columns.Add("name");
  392. dtPSize.Columns.Add("Cunt");
  393. for (int k = 0; k < temp.Count; k++)
  394. {
  395. string str = temp[k];
  396. string d1 = str.Split('~')[0];
  397. string d2 = str.Split('~')[1];
  398. if (d2 == "MAX")
  399. {
  400. d2 = "999";
  401. }
  402. DataRow[] datas = dtp.Select(getWhere(d2, d1, po));
  403. DataRow dr = dtPSize.NewRow();
  404. dr["name"] = str;
  405. dr["Cunt"] = datas.Count().ToString();
  406. dtPSize.Rows.Add(dr);
  407. }
  408. ListData.Add(dtPSize);
  409. break;
  410. }
  411. }
  412. return ListData;
  413. }
  414. #endregion
  415. /// <summary>
  416. /// 折线图
  417. /// </summary>
  418. /// <param name="sender"></param>
  419. /// <param name="e"></param>
  420. private void checkButton2_CheckedChanged(object sender, EventArgs e)
  421. {
  422. if(checkButton2.Checked)
  423. {
  424. checkButton1.Checked = false;
  425. checkButton3.Checked = false;
  426. chartControl1.Series.Clear();
  427. for (int i=0;i< prListData.Count;i++)
  428. {
  429. string str = prListString[i];
  430. // 假设你已经有一个 ChartControl 实例,并且已经添加了一个饼图 Series
  431. Series series = new Series(str, ViewType.Line);
  432. for (int a = 0; a < prListData[i].Rows.Count; a++)
  433. {
  434. string name = prListData[i].Rows[a]["name"].ToString();
  435. double Cunt = Convert.ToDouble(prListData[i].Rows[a]["Cunt"]);
  436. series.Points.Add(new SeriesPoint(name, Cunt));
  437. }
  438. series.LabelsVisibility = DefaultBoolean.True;
  439. series.Label.TextPattern = "{V}";
  440. chartControl1.Series.Add(series);
  441. }
  442. chartControl1.Legend.Visibility = DefaultBoolean.False;
  443. chartControl1.Refresh();
  444. }
  445. else
  446. {
  447. if (!checkButton1.Checked && !checkButton3.Checked)
  448. {
  449. checkButton2.Checked = false;
  450. }
  451. }
  452. }
  453. /// <summary>
  454. /// 柱状图
  455. /// </summary>
  456. /// <param name="sender"></param>
  457. /// <param name="e"></param>
  458. private void checkButton1_CheckedChanged(object sender, EventArgs e)
  459. {
  460. if (checkButton1.Checked)
  461. {
  462. checkButton2.Checked = false;
  463. checkButton3.Checked = false;
  464. chartControl1.Series.Clear();
  465. for (int i = 0; i < prListData.Count; i++)
  466. {
  467. string str = prListString[i];
  468. // 假设你已经有一个 ChartControl 实例,并且已经添加了一个饼图 Series
  469. Series series = new Series(str, ViewType.Bar);
  470. for (int a = 0; a < prListData[i].Rows.Count; a++)
  471. {
  472. string name = prListData[i].Rows[a]["name"].ToString();
  473. double Cunt = Convert.ToDouble(prListData[i].Rows[a]["Cunt"]);
  474. series.Points.Add(new SeriesPoint(name, Cunt));
  475. }
  476. series.LabelsVisibility = DefaultBoolean.True;
  477. series.Label.TextPattern = "{V}";
  478. chartControl1.Series.Add(series);
  479. }
  480. chartControl1.Legend.Visibility = DefaultBoolean.False;
  481. chartControl1.Refresh();
  482. }
  483. else
  484. {
  485. if (!checkButton2.Checked && !checkButton3.Checked)
  486. {
  487. checkButton1.Checked = true;
  488. }
  489. }
  490. }
  491. private void checkButton3_CheckedChanged(object sender, EventArgs e)
  492. {
  493. if (checkButton3.Checked)
  494. {
  495. checkButton1.Checked = false;
  496. checkButton2.Checked = false;
  497. chartControl1.Series.Clear();
  498. for (int i = 0; i < prListData.Count; i++)
  499. {
  500. string str = prListString[i];
  501. Series series = new Series(str, ViewType.Pie);
  502. for (int a = 0; a < prListData[i].Rows.Count; a++)
  503. {
  504. string name = prListData[i].Rows[a]["name"].ToString();
  505. double Cunt = Convert.ToDouble(prListData[i].Rows[a]["Cunt"]);
  506. series.Points.Add(new SeriesPoint(name, Cunt));
  507. }
  508. series.LabelsVisibility = DefaultBoolean.True;
  509. series.Label.TextPattern = "{A}";
  510. chartControl1.Series.Add(series);
  511. }
  512. chartControl1.Legend.Visibility = DefaultBoolean.False;
  513. chartControl1.Refresh();
  514. }
  515. else
  516. {
  517. if (!checkButton1.Checked && !checkButton2.Checked)
  518. {
  519. checkButton3.Checked = true;
  520. }
  521. }
  522. }
  523. }
  524. }