【问题标题】:T chart : overloading series and chart methodT 图表:重载系列和图表方法
【发布时间】:2015-11-30 23:04:51
【问题描述】:

我想在 api 中为系列和图表类添加方法

像这样重载 Add 方法 int Add(日期时间 x,双 y,双索引) 我想添加索引参数 因为系统需要。 如果我将此功能添加到类。 我没事儿的? 有什么问题吗?

然后我将事件函数添加到图表类。

总之,我需要特定的参数索引,我必须接收参数 当鼠标按下时。

如果有人有这样的工作经验。

请给我一个建议。

非常感谢。

【问题讨论】:

  • 您对哪个 TeeChart 版本感兴趣:VCL/FMX、.NET、ActiveX、Java 等?

标签: .net wpf teechart


【解决方案1】:

您可能对我在here 制作的 RectangleBubble 自定义系列示例感兴趣。这个自定义系列向基类添加了额外的ValueLists。您可以在 MouseDown 事件中轻松地从 ValueList 中检索任何值,例如:

public Form1()
{
  InitializeComponent();
  InitializeChart();
}

private void InitializeChart()
{
  tChart1.Aspect.View3D = false;
  tChart1.Series.Add(new Steema.TeeChart.Styles.Bar()).FillSampleValues();

  tChart1.MouseDown += TChart1_MouseDown;
}

private void TChart1_MouseDown(object sender, MouseEventArgs e)
{
  int index = tChart1.Series[0].Clicked(e.X, e.Y);

  if (index != -1)
  {
    double value = tChart1.Series[0].YValues[index];
    MessageBox.Show(value.ToString());
  }
}

顺便说一句,您可能还对讨论here 的自定义系列序列化感兴趣。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-01-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多