Highcharts.net包装器中的highcharts响应方法

时间:2019-03-13 14:05:28

标签: highcharts responsive

我想知道此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
    {
    }
}

1 个答案:

答案 0 :(得分:0)

chartOptionsobject类型

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 }
                    }
                }
            };