本文整理汇总了C#中Chart.GetHtmlImageMap方法的典型用法代码示例。如果您正苦于以下问题:C# Chart.GetHtmlImageMap方法的具体用法?C# Chart.GetHtmlImageMap怎么用?C# Chart.GetHtmlImageMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chart
的用法示例。
在下文中一共展示了Chart.GetHtmlImageMap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BindChart
//.........这里部分代码省略.........
// chart1.ChartAreas("Default").AxisX.IsMarginVisible = False
ca.AxisX.IsMarginVisible = false;
// ca.AxisX.IsStartedFromZero = false;
//chart1.ChartAreas[0].AxisX.IntervalOffset =-1;
//ca.AxisY2.TitleFont = titleFont;
//ca.AxisY2.TextOrientation = TextOrientation.Horizontal;
ca.AxisY2.MajorGrid.LineDashStyle = ChartDashStyle.Dash;
ca.AxisY.MajorGrid.LineDashStyle = ChartDashStyle.Dash;
ca.AxisY.Minimum = 0;
ca.AxisX.MajorGrid.LineColor = System.Drawing.Color.LightGray;
// ca.AxisX.LabelStyle.Angle = 90;
// ca.AxisX.Minimum = -1;
DataView dvView = dt.DefaultView;
// ToTable的第一個變數即為是否Distinct
DataTable dtLine = dvView.ToTable(true, "Line");
chart1.ChartAreas[0].AxisX.Interval = 1;
// chart1.ChartAreas[0].AxisX.IntervalOffset =-1;
DataRow[] drDataArray;
string line = "";
string beginTime;
string endTime;
float FPF = 0;
float FPF_1 = 0;
string select;
string timeSpn;
List<string> lstTime = GetTimeRange();
// chart1.Series[0].ToolTip = "#VALY, #VALX";
int count ;
string tipRate;
foreach (DataRow drLine in dtLine.Select("Line<>'zzTotal'"))
{
line = drLine[0].ToString().Trim();
Series serFPFRate = new Series(line);
// serFPFRate.IsValueShownAsLabel = true;
// serFPFRate.ToolTip = "#VALY, #VALX";
serFPFRate.ToolTip = "Line: " + line;
chart1.Series.Add(serFPFRate);
serFPFRate.LabelFormat = "0%";
serFPFRate.ChartType = SeriesChartType.Line;
serFPFRate.BorderWidth = 3;
// serFPFRate.SmartLabelStyle.AllowOutsidePlotArea = LabelOutsidePlotAreaStyle.No;
serFPFRate.ChartArea = "Main";
serFPFRate.YAxisType = AxisType.Primary;
serFPFRate.MarkerStyle = MarkerStyle.Circle;
serFPFRate.MarkerSize = 8;
count = 0;
foreach (string time in lstTime)
{
select = "Line='{0}' and BeginTime='{1}' and EndTime='{2}'";
beginTime = time.Split('-')[0].Trim();
endTime = time.Split('-')[1].Trim();
timeSpn = beginTime + "-" + endTime;
select = string.Format(select, line, beginTime, endTime);
drDataArray = dt.Select(select);
if (drDataArray.Length == 0)
{
serFPFRate.Points.AddXY(timeSpn, FPF_1);
tipRate="0";
}
else
{
FPF = float.Parse(drDataArray[0]["FPF"].ToString());
tipRate = string.Format("{0:0.00%}", FPF);
serFPFRate.Points.AddXY(timeSpn, FPF);
// serFPFRate.Points[count].ToolTip = "FPF : " + tipRate + "\nLine: " + line;
// serFPFRate.Points[count].ToolTip = "Line: " + line;
}
count++;
}
}
// chart1.Series["B1D"].Points[3].ToolTip = "xxxxxxxxx";
//double d1= chart1.Series["B1D"].Points[3].XValue;
//double[] d2 = chart1.Series["B1D"].Points[3].YValues;
string guid = System.Guid.NewGuid().ToString();
chart1.SaveImage(imgPath + guid + ".png", ChartImageFormat.Png);
string map = chart1.GetHtmlImageMap("chartMap");
arrReturn[0] = guid;
arrReturn[1] = map;
return arrReturn;
}