1

我有一个需要在图表上放置自定义标签的情况。我知道下面的 jQuery 可以完成这项工作,但我需要从后面的代码中完成。我看到了 highchart codeplex (http://highcharts.codeplex.com/) 来获取 Labels/Items 类,但它不存在。此外,我写了我自己的课程如下,但没有运气。

jQuery

labels: { items : [{ html : labelme ,style : { left: '10px',top: '300px'}}] }

C#各自的类

Labels Class:

namespace Test.Core

{ [可序列化]

public class Labels
{      

    public CSSObject style { get; set; }

    public Items items { get; set; }

    public Labels()
    {

    }
 }

物品类别:

namespace Test.Core
{
  [Serializable]
public class Items
{
     public CSSObject style { get; set; }

    public string html { get; set; }

    public Items()
    {

    }
}
}

在创建图表实例时,我确实编写了以下代码:

chart = new LineChart
        {
Labels = new IMCharts.src.HighchartsNet.Labels.Labels
            {
                items = new Items
                {
                    html = "90 days mean change is 27%",
                    style = new CSSObject { top = "100px", left = "100px" }
                },
                style = new CSSObject { color = "#3E576F" }
            }

}

请让我知道这里是否有任何问题,或者非常感谢任何帮助。

谢谢普鲁什

4

0 回答 0