init lserp cs 5.0
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Lskj.MyControl.Panel_Chart
|
||||
{
|
||||
public class ChartType {
|
||||
public static int bar = 2; //树状图
|
||||
public static int pie = 3; //饼图
|
||||
public static int line = 1; //线
|
||||
}
|
||||
}
|
||||
+150
@@ -0,0 +1,150 @@
|
||||
namespace Lskj.MyControl.Panel_Chart
|
||||
{
|
||||
partial class Panel_Chart
|
||||
{
|
||||
/// <summary>
|
||||
/// 必需的设计器变量。
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 清理所有正在使用的资源。
|
||||
/// </summary>
|
||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region 组件设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
DevExpress.XtraCharts.SimpleDiagram simpleDiagram1 = new DevExpress.XtraCharts.SimpleDiagram();
|
||||
DevExpress.XtraCharts.Series series1 = new DevExpress.XtraCharts.Series();
|
||||
DevExpress.XtraCharts.PieSeriesLabel pieSeriesLabel1 = new DevExpress.XtraCharts.PieSeriesLabel();
|
||||
DevExpress.XtraCharts.PiePointOptions piePointOptions1 = new DevExpress.XtraCharts.PiePointOptions();
|
||||
DevExpress.XtraCharts.PieSeriesView pieSeriesView1 = new DevExpress.XtraCharts.PieSeriesView();
|
||||
DevExpress.XtraCharts.PointSeriesLabel pointSeriesLabel1 = new DevExpress.XtraCharts.PointSeriesLabel();
|
||||
DevExpress.XtraCharts.LineSeriesView lineSeriesView1 = new DevExpress.XtraCharts.LineSeriesView();
|
||||
this.pl_main = new System.Windows.Forms.Panel();
|
||||
this.chartMain = new DevExpress.XtraCharts.ChartControl();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.gcMain = new DevExpress.XtraGrid.GridControl();
|
||||
this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView();
|
||||
this.pl_main.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.chartMain)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(simpleDiagram1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(series1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(pieSeriesLabel1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(pieSeriesView1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(pointSeriesLabel1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(lineSeriesView1)).BeginInit();
|
||||
this.panel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gcMain)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridView1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// pl_main
|
||||
//
|
||||
this.pl_main.Controls.Add(this.chartMain);
|
||||
this.pl_main.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pl_main.Location = new System.Drawing.Point(0, 0);
|
||||
this.pl_main.Name = "pl_main";
|
||||
this.pl_main.Size = new System.Drawing.Size(814, 259);
|
||||
this.pl_main.TabIndex = 1;
|
||||
//
|
||||
// chartMain
|
||||
//
|
||||
simpleDiagram1.EqualPieSize = false;
|
||||
this.chartMain.Diagram = simpleDiagram1;
|
||||
this.chartMain.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.chartMain.Location = new System.Drawing.Point(0, 0);
|
||||
this.chartMain.Name = "chartMain";
|
||||
pieSeriesLabel1.LineVisible = true;
|
||||
piePointOptions1.PointView = DevExpress.XtraCharts.PointView.ArgumentAndValues;
|
||||
piePointOptions1.ValueNumericOptions.Format = DevExpress.XtraCharts.NumericFormat.General;
|
||||
pieSeriesLabel1.PointOptions = piePointOptions1;
|
||||
series1.Label = pieSeriesLabel1;
|
||||
series1.Name = "Series 1";
|
||||
pieSeriesView1.RuntimeExploding = false;
|
||||
series1.View = pieSeriesView1;
|
||||
this.chartMain.SeriesSerializable = new DevExpress.XtraCharts.Series[] {
|
||||
series1};
|
||||
pointSeriesLabel1.LineVisible = true;
|
||||
this.chartMain.SeriesTemplate.Label = pointSeriesLabel1;
|
||||
this.chartMain.SeriesTemplate.View = lineSeriesView1;
|
||||
this.chartMain.Size = new System.Drawing.Size(814, 259);
|
||||
this.chartMain.TabIndex = 1;
|
||||
this.chartMain.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.chartMain_MouseDoubleClick);
|
||||
this.chartMain.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chartMain_MouseMove);
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.gcMain);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.panel1.Location = new System.Drawing.Point(0, 259);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(814, 184);
|
||||
this.panel1.TabIndex = 2;
|
||||
this.panel1.Visible = false;
|
||||
//
|
||||
// gcMain
|
||||
//
|
||||
this.gcMain.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.gcMain.Location = new System.Drawing.Point(0, 0);
|
||||
this.gcMain.MainView = this.gridView1;
|
||||
this.gcMain.Name = "gcMain";
|
||||
this.gcMain.Size = new System.Drawing.Size(814, 184);
|
||||
this.gcMain.TabIndex = 1;
|
||||
this.gcMain.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
|
||||
this.gridView1});
|
||||
//
|
||||
// gridView1
|
||||
//
|
||||
this.gridView1.GridControl = this.gcMain;
|
||||
this.gridView1.Name = "gridView1";
|
||||
this.gridView1.OptionsBehavior.Editable = false;
|
||||
this.gridView1.OptionsView.ShowGroupPanel = false;
|
||||
//
|
||||
// Panel_Chart
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.pl_main);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Name = "Panel_Chart";
|
||||
this.Size = new System.Drawing.Size(814, 443);
|
||||
this.pl_main.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(simpleDiagram1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(pieSeriesLabel1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(pieSeriesView1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(series1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(pointSeriesLabel1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(lineSeriesView1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.chartMain)).EndInit();
|
||||
this.panel1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.gcMain)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridView1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel pl_main;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private DevExpress.XtraGrid.GridControl gcMain;
|
||||
private DevExpress.XtraGrid.Views.Grid.GridView gridView1;
|
||||
private DevExpress.XtraCharts.ChartControl chartMain;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,379 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using CommonLib;
|
||||
using System.Data.SqlClient;
|
||||
using DevExpress.XtraCharts;
|
||||
using DevExpress.Utils;
|
||||
|
||||
namespace Lskj.MyControl.Panel_Chart
|
||||
{
|
||||
public partial class Panel_Chart : UserControl
|
||||
{
|
||||
public string DLLCoid { get; set; }
|
||||
public string formKey { get; set; }
|
||||
public string FormText { get; set; }
|
||||
public string OperatorId { get; set; }
|
||||
public string OperatorName { get; set; }
|
||||
public string Privilege { get; set; }
|
||||
public ChartControl chartControl { get { return chartMain; } }
|
||||
public SeriesPoint seriesPoint { get; set; }
|
||||
|
||||
private Color[] colorList = { Color.Red, Color.Orange, Color.Black, Color.Blue, Color.BlueViolet, Color.BlanchedAlmond };
|
||||
//private string Formkey;
|
||||
//private string CondKey;
|
||||
|
||||
private DataTable dtTypeChart;
|
||||
private DataTable dtData;
|
||||
public string ConstSQL = string.Empty;
|
||||
private ToolTipController toolTipController = new ToolTipController();
|
||||
public string SQL
|
||||
{
|
||||
get { return reportSql; }
|
||||
set {
|
||||
String chartSql = String.Format("select * from p_systemdlltabchart where tabkey='{0}' and isVisible=0", formKey);
|
||||
if (dtTypeChart == null)
|
||||
{
|
||||
dtTypeChart = SqlHelper.ExecuteDataSet(chartSql).Tables[0];
|
||||
}
|
||||
reportSql = value;
|
||||
|
||||
dtData = SqlHelper.ExecuteDataSet(reportSql).Tables[0];
|
||||
CreateChart();
|
||||
}
|
||||
}
|
||||
|
||||
public int AutoQuery { get; set; }
|
||||
public string[] Params { get; set; }
|
||||
private string reportSql = string.Empty;
|
||||
|
||||
public Panel_Chart()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
//String SQL = String.Format("select * from p_systemdlltab where dllcoid='{0}'", DLLCoid);
|
||||
//DataTable dtSystemdlltab = SqlHelper.ExecuteDataSet(SQL).Tables[0];
|
||||
//if (dtSystemdlltab != null && dtSystemdlltab.Rows.Count > 0)
|
||||
//{
|
||||
// reportSql = dtSystemdlltab.Rows[0]["SQL"] + "";
|
||||
// if (dtSystemdlltab.Rows.Count > 0)
|
||||
// {
|
||||
// Formkey = dtSystemdlltab.Rows[0]["formKey"] + "";
|
||||
// CondKey = dtSystemdlltab.Rows[0]["CondKey"] + "";
|
||||
// }
|
||||
// SqlParameter[] p =
|
||||
// {
|
||||
// new SqlParameter("@modid",SqlDbType.VarChar,50),
|
||||
// new SqlParameter("@operatorname",SqlDbType.VarChar,50)
|
||||
// };
|
||||
// p[0].Value = DLLCoid;
|
||||
// p[1].Value = OperatorName;
|
||||
//DataTable dtFileds = SqlHelper.ExecuteDataSet(CommandType.StoredProcedure, "p_getBaseModuleField", "temp", p).Tables[0];
|
||||
//PubControl.SetColumns(gcMain, dtFileds);
|
||||
//String chartSql = String.Format("select * from p_systemdlltabchart where tabkey='{0}' and isVisible=0", formKey);
|
||||
//dtTypeChart = SqlHelper.ExecuteDataSet(chartSql).Tables[0];
|
||||
//reportSql = SQL;
|
||||
//dtData = SqlHelper.ExecuteDataSet(reportSql).Tables[0];
|
||||
//CreateChart();
|
||||
//添加右键菜单
|
||||
//DataRow dtSystemwordbooktaNo = SqlHelper.ExecuteDataSet("select top 1 * from P_systemwordbooktab where tab='" + DLLCoid + "' order by orderid").Tables[0].Rows[0];
|
||||
//GridMenu gm = new GridMenu(FormText, OperatorId, OperatorName, Privilege, DLLCoid, "", gcMain);
|
||||
//gm.DirId = dtSystemdlltab.Rows[0]["dirid"] + "";
|
||||
//gm.filedKey = dtSystemwordbooktaNo["fieldname"].ToString();
|
||||
//gm.BindGridMenuWQ(DLLCoid);
|
||||
//}
|
||||
//gcMain.DataSource = dtData;
|
||||
//SearchCraeteControl();
|
||||
chartMain.RuntimeHitTesting = true;
|
||||
|
||||
}
|
||||
|
||||
private void CreateChart()
|
||||
{
|
||||
if (chartMain.Diagram is XYDiagram)
|
||||
((XYDiagram)chartMain.Diagram).SecondaryAxesY.Clear();
|
||||
chartMain.Series.Clear();
|
||||
for (int i = 0; i < dtTypeChart.Rows.Count; i++)
|
||||
{
|
||||
DataRow row = dtTypeChart.Rows[i];
|
||||
int chartType = Convert.ToInt32(row["chartType"]);
|
||||
int YAxisShared = Convert.ToInt32(row["YAxisShared"]);
|
||||
String YAxisTitle = row["YAxisTitle"] + "";
|
||||
int chart3D = Convert.ToInt32(row["chart3D"]);
|
||||
|
||||
Series series = null;
|
||||
if (chartType == ChartType.line)
|
||||
{
|
||||
if (chart3D == 1)
|
||||
{
|
||||
series = new Series(YAxisTitle, ViewType.Line3D);
|
||||
}
|
||||
else
|
||||
{
|
||||
series = new Series(YAxisTitle, ViewType.Line);
|
||||
}
|
||||
}
|
||||
else if (chartType == ChartType.bar)
|
||||
{
|
||||
if (chart3D == 1)
|
||||
{
|
||||
series = new Series(YAxisTitle, ViewType.Bar3D);
|
||||
}
|
||||
else
|
||||
{
|
||||
series = new Series(YAxisTitle, ViewType.Bar);
|
||||
}
|
||||
}
|
||||
else if (chartType == ChartType.pie)
|
||||
{
|
||||
if (chart3D == 1)
|
||||
{
|
||||
series = new Series(YAxisTitle, ViewType.Doughnut3D);
|
||||
((PiePointOptions)series.LegendPointOptions).PointView = PointView.ArgumentAndValues;
|
||||
Doughnut3DSeriesView view = series.View as Doughnut3DSeriesView;
|
||||
view.ExplodeMode = PieExplodeMode.All;
|
||||
series.LegendPointOptions.ValueNumericOptions.Format = NumericFormat.Percent;
|
||||
series.LabelsVisibility = DefaultBoolean.True;
|
||||
PiePointOptions options = series.Label.PointOptions as PiePointOptions;
|
||||
if (options != null)
|
||||
{
|
||||
options.PercentOptions.ValueAsPercent = true;
|
||||
options.PointView = PointView.ArgumentAndValues;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
series = new Series(YAxisTitle, ViewType.Pie);
|
||||
PiePointOptions options = series.Label.PointOptions as PiePointOptions;
|
||||
series.LegendPointOptions.ValueNumericOptions.Format = NumericFormat.Percent;
|
||||
((PiePointOptions)series.LegendPointOptions).PointView = PointView.ArgumentAndValues;
|
||||
PieSeriesView view = series.View as PieSeriesView;
|
||||
view.ExplodeMode = PieExplodeMode.All;
|
||||
view.Rotation = 50;
|
||||
view.RuntimeExploding = true;
|
||||
series.LabelsVisibility = DefaultBoolean.True;
|
||||
if (options != null)
|
||||
{
|
||||
options.PercentOptions.ValueAsPercent = true;
|
||||
options.PointView = PointView.ArgumentAndValues;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (series != null)
|
||||
{
|
||||
series.View.Color = System.Drawing.ColorTranslator.FromHtml(row["chartColor"] + "");
|
||||
}
|
||||
foreach (DataRow dr in dtData.Rows)
|
||||
{
|
||||
String XLabelField = row["XLabelField"] + "";
|
||||
String YValueField = row["YValueField"] + "";
|
||||
if (chartType == ChartType.pie)
|
||||
{
|
||||
if (chart3D == 1)
|
||||
{
|
||||
CreateSeriesPie3D(dr[XLabelField] + "", dr[YValueField] + "", series);
|
||||
}
|
||||
else
|
||||
{
|
||||
CreateSeriesPie(dr[XLabelField] + "", dr[YValueField] + "", series);
|
||||
}
|
||||
}
|
||||
else if (chartType == ChartType.bar)
|
||||
{
|
||||
if (chart3D == 1)
|
||||
{
|
||||
CreateSeriesBar3D(dr[XLabelField] + "", dr[YValueField] + "", series);
|
||||
}
|
||||
else
|
||||
{
|
||||
CreateSeries(dr[XLabelField] + "", dr[YValueField] + "", series);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CreateSeries(dr[XLabelField] + "", dr[YValueField] + "", series);
|
||||
}
|
||||
}
|
||||
|
||||
chartMain.Series.Add(series);
|
||||
|
||||
if ((YAxisShared == 0)&&(series!=null))
|
||||
{
|
||||
CreateAxisY(series, chartType, chart3D);
|
||||
}
|
||||
}
|
||||
chartMain.Legend.Visible = true;
|
||||
chartMain.SeriesTemplate.LabelsVisibility = DefaultBoolean.True;
|
||||
chartMain.CrosshairEnabled = DefaultBoolean.True;
|
||||
chartMain.ToolTipEnabled = DefaultBoolean.True;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据数据创建一个图形展现
|
||||
/// </summary>
|
||||
/// <param name="caption">图形标题</param>
|
||||
/// <param name="viewType">图形类型</param>
|
||||
/// <param name="dt">数据DataTable</param>
|
||||
/// <param name="rowIndex">图形数据的行序号</param>
|
||||
/// <returns></returns>
|
||||
private Series CreateSeriesBar3D(String colName, String colValue, Series series)
|
||||
{
|
||||
series.Points.Add(new SeriesPoint(colName + "" == "" ? "*指标为空*" : colName, new double[] { Convert.ToDouble(colValue + "" == "" ? "0" : colValue) }));
|
||||
return series;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据数据创建一个图形展现
|
||||
/// </summary>
|
||||
/// <param name="caption">图形标题</param>
|
||||
/// <param name="viewType">图形类型</param>
|
||||
/// <param name="dt">数据DataTable</param>
|
||||
/// <param name="rowIndex">图形数据的行序号</param>
|
||||
/// <returns></returns>
|
||||
private Series CreateSeriesPie3D(String colName, String colValue, Series series)
|
||||
{
|
||||
series.Points.Add(new SeriesPoint(colName + "" == "" ? "*指标为空*" : colName, new double[] { Convert.ToDouble(colValue + "" == "" ? "0" : colValue) }));
|
||||
return series;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据数据创建一个图形展现
|
||||
/// </summary>
|
||||
/// <param name="caption">图形标题</param>
|
||||
/// <param name="viewType">图形类型</param>
|
||||
/// <param name="dt">数据DataTable</param>
|
||||
/// <param name="rowIndex">图形数据的行序号</param>
|
||||
/// <returns></returns>
|
||||
private Series CreateSeriesPie(String colName, String colValue, Series series)
|
||||
{
|
||||
series.Points.Add(new SeriesPoint(colName + "" == "" ? "*指标为空*" : colName, new double[] { Convert.ToDouble(colValue + "" == "" ? "0" : colValue) }));
|
||||
return series;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据数据创建一个图形展现
|
||||
/// </summary>
|
||||
/// <param name="caption">图形标题</param>
|
||||
/// <param name="viewType">图形类型</param>
|
||||
/// <param name="dt">数据DataTable</param>
|
||||
/// <param name="rowIndex">图形数据的行序号</param>
|
||||
/// <returns></returns>
|
||||
private Series CreateSeries(String colName, String colValue, Series series)
|
||||
{
|
||||
series.Points.Add(new SeriesPoint(colName + "" == "" ? "*指标为空*" : colName, colValue+"" == "" ? "0" : colValue));
|
||||
series.ArgumentScaleType = ScaleType.Qualitative;
|
||||
series.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;//显示标注标签
|
||||
return series;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建图表的第二坐标系
|
||||
/// </summary>
|
||||
/// <param name="series">Series对象</param>
|
||||
/// <returns></returns>
|
||||
private SecondaryAxisY CreateAxisY(Series series, int chartType, int chart3D)
|
||||
{
|
||||
|
||||
SecondaryAxisY myAxis = new SecondaryAxisY(series.Name);
|
||||
((XYDiagram)chartMain.Diagram).SecondaryAxesY.Add(myAxis);
|
||||
if (chartType == ChartType.line)
|
||||
((LineSeriesView)series.View).AxisY = myAxis;
|
||||
if (chartType == ChartType.bar)
|
||||
((BarSeriesView)series.View).AxisY = myAxis;
|
||||
|
||||
myAxis.Title.Text = series.Name;
|
||||
myAxis.Title.Alignment = StringAlignment.Far; //顶部对齐
|
||||
myAxis.Title.Visible = true; //显示标题
|
||||
myAxis.Title.Font = new Font("宋体", 9.0f);
|
||||
Color color = series.View.Color;//设置坐标的颜色和图表线条颜色一致
|
||||
myAxis.Title.TextColor = color;
|
||||
myAxis.Label.TextColor = color;
|
||||
myAxis.Color = color;
|
||||
return myAxis;
|
||||
}
|
||||
|
||||
private void chartMain_MouseClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void chartMain_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
seriesPoint = null;
|
||||
ChartHitInfo hitInfo = chartMain.CalcHitInfo(e.Location);
|
||||
StringBuilder builder = new StringBuilder();
|
||||
if (hitInfo.InDiagram)
|
||||
builder.AppendLine("In Diagram");
|
||||
if (hitInfo.InNonDefaultPane)
|
||||
builder.AppendLine("In non-default pane: " + hitInfo.NonDefaultPane.Name);
|
||||
if (hitInfo.InAxis)
|
||||
{
|
||||
builder.AppendLine("In axis: " + hitInfo.Axis.Name);
|
||||
if (hitInfo.AxisLabelItem != null)
|
||||
builder.AppendLine(" Label item: " + hitInfo.AxisLabelItem.Text);
|
||||
if (hitInfo.AxisTitle != null)
|
||||
builder.AppendLine(" Axis title: " + hitInfo.AxisTitle.Text);
|
||||
}
|
||||
if (hitInfo.InChartTitle)
|
||||
builder.AppendLine("In chart title: " + hitInfo.ChartTitle.Text);
|
||||
if (hitInfo.InLegend)
|
||||
builder.AppendLine("In legend");
|
||||
if (hitInfo.InSeries)
|
||||
builder.AppendLine("In series: " + ((Series)hitInfo.Series).Name);
|
||||
if (hitInfo.InSeriesLabel)
|
||||
{
|
||||
builder.AppendLine("In series label");
|
||||
builder.AppendLine(" Series: " + ((Series)hitInfo.Series).Name);
|
||||
}
|
||||
if (hitInfo.SeriesPoint != null)
|
||||
{
|
||||
seriesPoint = hitInfo.SeriesPoint;
|
||||
builder.AppendLine(" Argument: " + hitInfo.SeriesPoint.Argument);
|
||||
if (!hitInfo.SeriesPoint.IsEmpty)
|
||||
builder.AppendLine(" Value: " + hitInfo.SeriesPoint.Values[0]);
|
||||
}
|
||||
//if (builder.Length > 0)
|
||||
// toolTipController.ShowHint("Hit-testing results:\n" + builder.ToString(), chartMain.PointToScreen(e.Location));
|
||||
//else
|
||||
// toolTipController.HideHint();
|
||||
}
|
||||
|
||||
private void chartMain_MouseDoubleClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
ChartHitInfo hitInfo = chartMain.CalcHitInfo(e.Location);
|
||||
if (hitInfo.SeriesPoint != null)
|
||||
{
|
||||
if (chartMain.ContextMenuStrip != null)
|
||||
{
|
||||
foreach (ToolStripMenuItem item in chartMain.ContextMenuStrip.Items)
|
||||
{
|
||||
if (item.Tag == null)
|
||||
continue;
|
||||
DataRow dr = item.Tag as DataRow;
|
||||
if (dr == null)
|
||||
continue;
|
||||
|
||||
if (dr.Table.Columns.Contains("DBClickEvent"))
|
||||
{
|
||||
if (dr["DBClickEvent"] + "" == "1")
|
||||
{
|
||||
item.PerformClick();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
Reference in New Issue
Block a user