有没有人有使用新的 Dot Net Highcharts 包装器和更改系列颜色的工作示例?我只是不能让它改变我的生活,我想我一定改变了每一个颜色属性。它们都不是来自普通调色板的默认值。
@(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")
)
可以按照.NET Highcharts 的 API 参考中的说明按系列设置系列颜色。
...
Series = new List<Series>
{
new ColumnSeries
{
Color = "rgba(165,170,217,1)",
...
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句