var spread = new GC.Spread.Sheets.Workbook(document.getElementById('ss'), {
sheetCount: 1,
rowCount: 100,
columnCount: 26
});
var sheet = spread.getSheet(0);
spread.suspendPaint();
// 追加数据
var dataArray = [["eriod", "Zantedeschia", "Celosia", "Calendula"], [6, 13, 2, 3], [7, 14, 2, 4], [8, 15, 3, 5], [9, 16, 3, 7], [10, 17, 4, 9], [11, 22, 4, 11], [12, 27, 5, 12], [13, 30, 8, 13], [14, 32, 10, 14], [15, 34, 13, 15], [16, 36, 16, 15], [17, 37, 20, 15], [18, 39, 23, 15], [19, 40, 25, 15], [20, 40, 25, 15]];
sheet.setArray(0, 0, dataArray);
var chart = sheet.charts.add('xyScatterSmooth', GC.Spread.Sheets.Charts.ChartType.xyScatterSmooth, 0, 100, 500, 300, 'A116');
var series = chart.series();
series.remove(1);
series.remove(1);
var seriesItem = series.get(0);
seriesItem.axisGroup = 1;
series.set(0, seriesItem);
var axes = chart.axes();
axes.secondaryCategory.visible = true;
axes.secondaryCategory.style.color = 'green';
axes.secondaryCategory.title.color = 'green';
axes.secondaryValue.style.color = 'blue';
axes.secondaryValue.title.color = 'blue';
axes.secondaryValue.format = 'General';
axes.secondaryValue.title.text = 'Secondary Value Axes';
chart.axes(axes);
spread.resumePaint();
// 执行完这一行,图表的坐标轴样式会有变化,这是为什么,有什么方法可以解决吗?
// spread.fromJSON(JSON.parse(JSON.stringify(spread.toJSON())));
|