Google图表添加了次要Y轴和X-轴。我的代码仅支持X和Y轴

时间:2019-01-16 09:03:06

标签: jquery asp.net-mvc

Google图表添加了次要Y轴和X-轴。我的代码仅支持X和Y轴。 下面是代码片段。让我知道要添加的属性,以支持Google图表的辅助Y和X轴。 ASP.NET MVC,JQUERY

scope.InitGraphicOptions =函数(seriesOptions,intervalOptions,宽度,高度){

    if (seriesOptions == null) {
        return null;
    }
    var viewModel = ChartProps.GetViewModel();
    return {
        enableInteractivity: false,
        width: width != undefined ? width : 'auto',
        height: height != undefined ? height : 'auto',
        chartArea: {
            left: "10%",
            top: "0",
            height: "85%",
            width: "95%"
        },
        hAxis: {
            title: viewModel.XAxis.Title,
            titleTextStyle: {
                fontSize: 12
            },
            gridlines: {
                count: viewModel.XAxis.Gridlines
            },
            minorGridlines: {
                count: viewModel.XAxis.MinorGridlines
            },
            minValue: viewModel.XAxis.MinValue,
            maxValue: viewModel.XAxis.MaxValue,
            ticks: viewModel.XAxis.Ticks,
            textStyle: {
                fontSize: 12
            }
        },

        vAxes: {

            title: viewModel.YAxis.Title,
            titleTextStyle: {
                fontSize: 12
            },
            gridlines: {
                count: viewModel.YAxis.Gridlines
            },
            minorGridlines: {
                count: viewModel.YAxis.MinorGridlines
            },
            minValue: viewModel.YAxis.MinValue,
            maxValue: 1.1 * viewModel.YAxis.MaxValue,
            ticks: viewModel.YAxis.Ticks,
            textStyle: {
                fontSize: 12
                }
            },


        selectionMode: 'single',
        series: seriesOptions,


        intervals: {
            style: 'area'
        },
        interval: intervalOptions,
        smoothLine: true,
        interpolateNulls: true,
        async: false
    };
}

0 个答案:

没有答案