将背景颜色设置为DotNet.Highcharts
问题描述:
我正在使用DotNet.HighCharts,我想使图表透明。将背景颜色设置为DotNet.Highcharts
我在Javascript中找到了一个例子,可以通过设置backgroundColor为null。
有没有人知道DotNet.HighCharts中是否有类似的选项?
答
尝试backgroundColor
选项设置为none
:
chart: {
renderTo: 'container',
backgroundColor: 'none',
...
},
请参见本fiddle例如。
答
我有点老了,但我遇到了这个问题,我有一个很好的答案。
要在HighCharts
中设置透明,这是正确的方法。当然,任何颜色都可以从System.Drawing.Color
创建一个颜色对象!,然后分配给它的InitChart
var bgColor = new DotNet.Highcharts.Helpers.BackColorOrGradient(System.Drawing.Color.Transparent);
DotNet.Highcharts.Highcharts chart = new DotNet.Highcharts.Highcharts("chart")
.InitChart(new Chart {
DefaultSeriesType = ChartTypes.Line,
BackgroundColor = bgColor
})
看看答案在这里:http://dotnethighcharts.codeplex.com/discussions/352566 – Vangi 2012-04-18 22:06:25