Dot Net Highcharts 系列颜色

Dot Net Highcharts Series Color

有人有使用新的 Dot Net Highcharts 包装器和更改系列颜色的工作示例吗?我只是无法让它改变我的生活,我想我一定已经改变了每一种颜色 属性。 None 其中默认来自普通调色板。

@(Html.Highsoft().Highcharts(
new Highcharts
{
    Title = new Title
    {
        Text = "Picks Grouped By Target And Week Of Year"

    },

    XAxis = new List<XAxis>
    {
        new XAxis
        {
            Categories = WeeksOfYear.ConvertAll<string>(x => x.ToString())
        }
    },
    YAxis = new List<YAxis>
    {
        new YAxis
        {
            Min = 0,
            Title = new YAxisTitle
            {
                Text = "Number of picks"
            },
            StackLabels = new YAxisStackLabels
            {
                Enabled = true,
                Style = new Hashtable
                {
                    { "fontWeght", "bold" }
                }
            }
        }
    },
    Legend = new Legend
    {
        Align = LegendAlign.Right,
        X = -30,
        VerticalAlign = LegendVerticalAlign.Top,
        Y = 25,
        Floating = true,
        BorderColor = "#CCC",
        BorderWidth = 1,
        BackgroundColor = "white"

    },
    Tooltip = new Tooltip
    {
        Formatter = "formatToolTip"
    },
    PlotOptions = new PlotOptions
    {
        Column = new PlotOptionsColumn
        {

            Stacking = PlotOptionsColumnStacking.Normal,
            DataLabels = new PlotOptionsColumnDataLabels
            {
                Enabled = true,
                Color = "#FFFFFF",

                Shadow = new Shadow()
                {
                    Enabled = true,
                    Color = "black",
                    Width = 10,
                    OffsetX = 0,
                    OffsetY = 0
                }
            }
        }
    },

    Series = new List<Series>
    {
        new ColumnSeries
        {
            Name = "Over 45 Min",
            Data = @ViewData["StackedColumnOver45Min"] as List<ColumnSeriesData>

    },
        new ColumnSeries
        {
            Name = "Under 45 Min",
            Data = @ViewData["StackedColumnUnder45Min"] as List<ColumnSeriesData>

        }
    }
}
, "WeekOfYearSlaStackedColumn")
)

系列颜色可以按API reference for .NET Highcharts中的说明设置系列。

...
Series = new List<Series>
{
    new ColumnSeries
    {
        Color = "rgba(165,170,217,1)",
        ...

设置颜色(在 asp.net 的 Highcharts 中的任何地方)你应该使用这个结构:

using System.Drawing;

Color = ColorTranslator.FromHtml("#DFEEB2"),