/// <summary> /// 获取仪表盘XML字符串 /// </summary> /// <param name="dt"></param> /// <param name="c"></param> /// <param name="llist"></param> /// <param name="slist"></param> /// <param name="chartType"></param> /// <returns></returns> public string GetXMLData(AngularGaugeChart c, IList <colorRange> colorlist, IList <dials> diallist, IList <style> slist, IList <trendpoints> trendpointList, IList <annotations> annotationList, string chartName, string isload = "") { GetFusionChartDataXML getXML = new GetFusionChartDataXML(); StringBuilder sb_XMLData = new StringBuilder(); sb_XMLData.Append(getXML.GetFusionChartAngularGaugeStartXML(c)); sb_XMLData.Append(getXML.GetFusionChartAngularGaugeXML(colorlist, diallist, trendpointList, annotationList)); sb_XMLData.Append(getXML.GetFusionChartStyleXML(slist)); sb_XMLData.Append(getXML.GetFusionChartEndXML()); return(RenderChart( "../Scripts/FusionChart/Swf/AngularGauge.swf", "", sb_XMLData.ToString(), chartName, "350", "200", false, false )); }
/// <summary> /// 获取图表XML字符串(双轴) /// </summary> /// <param name="dt"></param> /// <param name="c"></param> /// <param name="llist"></param> /// <param name="slist"></param> /// <param name="chartType"></param> /// <returns></returns> public string GetXMLData(DataTable dt, chart c, IList <line> llist, IList <style> slist, FusionChartType chartType, IList <string> colors, string chartName, string chartWidth, string chartHeight, IList <string> countershaft, string isload = "") { GetFusionChartDataXML getXML = new GetFusionChartDataXML(); StringBuilder sb_XMLData = new StringBuilder(); colors = new List <string>(); while (colors.Count < dt.Columns.Count) { colors.Add("000080"); colors.Add("ff0000"); colors.Add("ff8901"); colors.Add("55FFFF"); colors.Add("00BF55"); colors.Add("FFBF00"); colors.Add("FFFF00"); colors.Add("FF9FFF"); colors.Add("00FB00"); colors.Add("FF9FFF"); colors.Add("FF9ooo"); colors.Add("EF9FFF"); colors.Add("5F9FFF"); colors.Add("000000"); colors.Add("55FFFF"); colors.Add("ffffff"); colors.Add("000080"); colors.Add("0ED1DC"); colors.Add("595959"); colors.Add("55FFFF"); colors.Add("00BF55"); colors.Add("FFBF00"); colors.Add("FFFF00"); colors.Add("FF9ooo"); colors.Add("EF9FFF"); colors.Add("5F9FFF"); colors.Add("000000"); colors.Add("000080"); colors.Add("ff0000"); colors.Add("595959"); colors.Add("55FFFF"); colors.Add("00BF55"); colors.Add("FFBF00"); colors.Add("FFFF00"); colors.Add("FF9FFF"); colors.Add("00FB00"); colors.Add("000080"); colors.Add("0ED1DC"); colors.Add("595959"); colors.Add("55FFFF"); colors.Add("00BF55"); colors.Add("FFBF00"); colors.Add("FFFF00"); colors.Add("FF9ooo"); colors.Add("EF9FFF"); colors.Add("5F9FFF"); } if (chartType == FusionChartType.MSColumn2D) { sb_XMLData.Append(getXML.GetFusionChartStartXML(c, chartName)); sb_XMLData.Append(getXML.GetFusionChartGeneralXML(dt, colors)); //sb_XMLData.Append(getXML.GetFusionChartTrendLinesXML(llist)); // sb_XMLData.Append(getXML.GetFusionChartStyleXML(slist)); sb_XMLData.Append(getXML.GetFusionChartEndXML()); return(RenderChart( "../Scripts/FusionChart/Swf/MSColumn2D.swf", "", sb_XMLData.ToString(), chartName, chartWidth, chartHeight, false, true )); } else if (chartType == FusionChartType.Doughnut2D) { sb_XMLData.Append(getXML.GetFusionChartStartXML(c, chartName)); sb_XMLData.Append(getXML.GetFusionChartSetXML(dt, colors)); sb_XMLData.Append(getXML.GetFusionChartStyleXML(slist)); sb_XMLData.Append(getXML.GetFusionChartEndXML()); return(RenderChart( "../Scripts/FusionChart/Swf/Doughnut2D.swf", "", sb_XMLData.ToString(), chartName, chartWidth, chartHeight, false, true )); } else if (chartType == FusionChartType.Pie2D) { sb_XMLData.Append(getXML.GetFusionChartStartXML(c, chartName)); sb_XMLData.Append(getXML.GetFusionChartSetXML(dt, colors)); sb_XMLData.Append(getXML.GetFusionChartStyleXML(slist)); sb_XMLData.Append(getXML.GetFusionChartEndXML()); if (!string.IsNullOrWhiteSpace(isload)) { return(sb_XMLData.ToString()); } else { return(RenderChart( "../Scripts/FusionChart/Swf/Pie2D.swf", "", sb_XMLData.ToString(), chartName, chartWidth, chartHeight, false, true )); } } else if (chartType == FusionChartType.AngularGauge) { sb_XMLData.Append(getXML.GetFusionChartStartXML(c, chartName)); sb_XMLData.Append(getXML.GetFusionChartGeneralXML(dt, colors)); sb_XMLData.Append(getXML.GetFusionChartTrendLinesXML(llist)); sb_XMLData.Append(getXML.GetFusionChartStyleXML(slist)); sb_XMLData.Append(getXML.GetFusionChartEndXML()); return(RenderChart( "../Scripts/FusionChart/Swf/AngularGauge.swf", "", sb_XMLData.ToString(), chartName, chartWidth, chartHeight, false, true )); } else if (chartType == FusionChartType.Bubble) { sb_XMLData.Append(getXML.GetFusionChartStartXML(c, chartName)); sb_XMLData.Append(getXML.GetFusionChartBubbleXML(dt)); sb_XMLData.Append(getXML.GetFusionChartStyleXML(slist)); sb_XMLData.Append(getXML.GetFusionChartEndXML()); return(RenderChart( "../Scripts/FusionChart/Swf/Bubble.swf", "", sb_XMLData.ToString(), chartName, chartWidth, chartHeight, false, true )); } else if (chartType == FusionChartType.Funnel) { sb_XMLData.Append(getXML.GetFusionChartStartXML(c, chartName)); sb_XMLData.Append(getXML.GetFusionChartSetXML(dt, colors)); //sb_XMLData.Append(getXML.GetFusionChartTrendLinesXML(llist)); // sb_XMLData.Append(getXML.GetFusionChartStyleXML(slist)); sb_XMLData.Append(getXML.GetFusionChartEndXML()); return(RenderChart( "../Scripts/FusionChart/Swf/Funnel.swf", "", sb_XMLData.ToString(), chartName, chartWidth, chartHeight, false, true )); } else if (chartType == FusionChartType.MSCombiDY2D) { sb_XMLData.Append(getXML.GetFusionChartStartXML(c, chartName)); sb_XMLData.Append(getXML.GetFusionChartGeneralXML(dt, colors, countershaft)); //sb_XMLData.Append(getXML.GetFusionChartStyleXML(slist)); sb_XMLData.Append(getXML.GetFusionChartEndXML()); return(RenderChart( "../Scripts/FusionChart/Swf/MSCombiDY2D.swf", "", sb_XMLData.ToString(), chartName, chartWidth, chartHeight, false, true )); } else if (chartType == FusionChartType.Line) { sb_XMLData.Append(getXML.GetFusionChartStartXML(c, chartName)); sb_XMLData.Append(getXML.GetFusionChartSetXML(dt, colors)); sb_XMLData.Append(getXML.GetFusionChartEndXML()); if (!string.IsNullOrWhiteSpace(isload)) { return(sb_XMLData.ToString()); } else { return(RenderChart( "../Scripts/FusionChart/Swf/Line.swf", "", sb_XMLData.ToString(), chartName, chartWidth, chartHeight, false, true )); } } else if (chartType == FusionChartType.Line2) { sb_XMLData.Append(getXML.GetFusionChartStartXML(c, chartName)); sb_XMLData.Append(getXML.GetFusionChartGeneralXML(dt, colors)); // sb_XMLData.Append(getXML.GetFusionChartTrendLinesXML(llist)); // sb_XMLData.Append(getXML.GetFusionChartStyleXML(slist)); sb_XMLData.Append(getXML.GetFusionChartEndXML()); if (!string.IsNullOrWhiteSpace(isload)) { return(sb_XMLData.ToString()); } else { return(RenderChart( "../Scripts/FusionChart/Swf/MSLine.swf", "", sb_XMLData.ToString(), chartName, chartWidth, chartHeight, false, true )); } } else if (chartType == FusionChartType.Pie3D) { sb_XMLData.Append(getXML.GetFusionChartStartXML(c, chartName)); sb_XMLData.Append(getXML.GetFusionChartSetXML(dt, colors)); sb_XMLData.Append(getXML.GetFusionChartStyleXML(slist)); sb_XMLData.Append(getXML.GetFusionChartEndXML()); if (!string.IsNullOrWhiteSpace(isload)) { return(sb_XMLData.ToString()); } else { return(RenderChart( "../Scripts/FusionChart/Swf/Pie3D.swf", "", sb_XMLData.ToString(), chartName, chartWidth, chartHeight, false, true )); } } return(""); }