我想知道此JavaScript代码的ASP.net包装器实现
responsive: {
rules
rules: [{
condition: {
maxWidth: 370
},
chartOptions: {
chart: {
width: 250,
height: 400,
marginLeft: 40,
marginTop:-120
},
legend: {
x: -20,
y: 260,
floating: true,
align: 'left',
verticalAlign: 'top',
layout: 'horizontal',
width: 300
}
}
}]
}
我以这种方式尝试过,但是没有为Condition和ChartOptions获得正确的命名空间
Responsive = new Responsive()
{
Rules= new List<ResponsiveRules>{
Condition = new ResponsiveRulesCondition()
{
MaxWidth = 375
},
ChartOptions
{
}
}
答案 0 :(得分:0)
chartOptions
是object
类型
Responsive responsive = new Responsive()
{
Rules = new List<Highsoft.Web.Mvc.Charts.ResponsiveRules>()
{
new Highsoft.Web.Mvc.Charts.ResponsiveRules
{
ChartOptions = new { chart = new { className = "small-chart" } },
Condition = new ResponsiveRulesCondition() { MaxWidth = 500 }
}
}
};