代码不适用于使用SEWP的SP在线网站页面

时间:2015-03-31 23:45:02

标签: javascript jquery html sharepoint-2013 sharepoint-online

如果我在SP 2013本地站点上使用但在SharePoint Online站点上不使用,则此方法将正常工作。它有时会在网上以编辑模式显示,但在保存后会消失...我已经使用了内容和脚本编辑器。任何想法??

  

<script language = "javascript" src="http://code.highcharts.com/highcharts.js">
<script language = "javascript" src="http://code.highcharts.com/modules/exporting.js"></script>  
<script type="text/javascript">
$(function () {
$('#container').highcharts({
    chart: {
        plotBackgroundColor: null,
        plotBorderWidth: null,
        plotShadow: false
    },
    title: {
        text: 'Browser market shares at a specific website, 2014'
    },
    tooltip: {
        pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
    },
    plotOptions: {
        pie: {
            allowPointSelect: true,
            cursor: 'pointer',
            dataLabels: {
                enabled: true,
                format: '<b>{point.name}</b>: {point.percentage:.1f} %',
                style: {
                    color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
                }
            }
        }
    },
    series: [{
        type: 'pie',
        name: 'Browser share',
        data: [
            ['Firefox',   45.0],
            ['IE',       26.8],
            {
                name: 'Chrome',
                y: 12.8,
                sliced: true,
                selected: true
            },
            ['Safari',    8.5],
            ['Opera',     6.2],
            ['Others',   0.7]
        ]
    }]
});

</script>

          

1 个答案:

答案 0 :(得分:0)