Commit 50aea9d5 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

Bug 25240 - Добавить подходящие данные для биржевой диаграммы

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57629 954022d7-b5bf-4e40-9824-e11837661b57
parent 9f52c6a6
...@@ -2671,8 +2671,18 @@ function DrawingObjects() { ...@@ -2671,8 +2671,18 @@ function DrawingObjects() {
function fillTableFromRef(ref) function fillTableFromRef(ref)
{ {
var cache = ref.numCache ? ref.numCache : (ref.strCache ? ref.strCache : null); var cache = ref.numCache ? ref.numCache : (ref.strCache ? ref.strCache : null);
var lit_format_code;
if(cache) if(cache)
{ {
if(typeof cache.formatCode === "string" && cache.formatCode.length > 0)
{
lit_format_code = cache.formatCode;
}
else
{
lit_format_code = "General"
}
var f1 = ref.f.replace(/\(|\)/g,""); var f1 = ref.f.replace(/\(|\)/g,"");
var arr_f = f1.split(","); var arr_f = f1.split(",");
var pt_index = 0, i, j, cell, pt; var pt_index = 0, i, j, cell, pt;
...@@ -2722,7 +2732,7 @@ function DrawingObjects() { ...@@ -2722,7 +2732,7 @@ function DrawingObjects() {
pt = cache.getPtByIndex(pt_index); pt = cache.getPtByIndex(pt_index);
if(pt) if(pt)
{ {
cell.setNumFormat(typeof pt.formatCode === "string" && pt.formatCode.length > 0 ? pt.formatCode : "General"); cell.setNumFormat(typeof pt.formatCode === "string" && pt.formatCode.length > 0 ? pt.formatCode : lit_format_code);
cell.setValue(pt.val + ""); cell.setValue(pt.val + "");
} }
++pt_index; ++pt_index;
...@@ -2736,7 +2746,7 @@ function DrawingObjects() { ...@@ -2736,7 +2746,7 @@ function DrawingObjects() {
pt = cache.getPtByIndex(pt_index); pt = cache.getPtByIndex(pt_index);
if(pt) if(pt)
{ {
cell.setNumFormat(typeof pt.formatCode === "string" && pt.formatCode.length > 0 ? pt.formatCode : "General"); cell.setNumFormat(typeof pt.formatCode === "string" && pt.formatCode.length > 0 ? pt.formatCode : lit_format_code);
cell.setValue(pt.val + ""); cell.setValue(pt.val + "");
} }
++pt_index; ++pt_index;
......
...@@ -2945,49 +2945,96 @@ DrawingObjectsController.prototype = ...@@ -2945,49 +2945,96 @@ DrawingObjectsController.prototype =
getSeriesDefault: function (type) { getSeriesDefault: function (type) {
// Обновлены тестовые данные для новой диаграммы // Обновлены тестовые данные для новой диаграммы
function createItem(value) {
return { numFormatStr: "General", isDateTimeFormat: false, val: value, isHidden: false };
} var series = [], seria, Cat;
var bIsScatter = (c_oAscChartTypeSettings.scatter <= type && type <= c_oAscChartTypeSettings.scatterSmoothMarker); var createItem = function(value) {
return { numFormatStr: "General", isDateTimeFormat: false, val: value, isHidden: false };
var Cat = { Formula: "Sheet1!A2:A7", NumCache: [createItem("USA"), createItem("CHN"), createItem("RUS"), createItem("GBR"), createItem("GER"), createItem("JPN")] }; };
var createItem2 = function(value, formatCode) {
var series = []; return { numFormatStr: formatCode, isDateTimeFormat: false, val: value, isHidden: false };
};
var seria = new asc_CChartSeria(); if(type !== c_oAscChartTypeSettings.stock)
seria.Val.Formula = "Sheet1!B2:B7"; {
seria.Val.NumCache = [ createItem(46), createItem(38), createItem(24), createItem(29), createItem(11), createItem(7) ];
seria.TxCache.Formula = "Sheet1!B1"; var bIsScatter = (c_oAscChartTypeSettings.scatter <= type && type <= c_oAscChartTypeSettings.scatterSmoothMarker);
seria.TxCache.Tx = "Gold";
if (!bIsScatter) Cat = { Formula: "Sheet1!A2:A7", NumCache: [createItem("USA"), createItem("CHN"), createItem("RUS"), createItem("GBR"), createItem("GER"), createItem("JPN")] };
seria.Cat = Cat;
else
seria.xVal = Cat; seria = new asc_CChartSeria();
series.push(seria); seria.Val.Formula = "Sheet1!B2:B7";
seria.Val.NumCache = [ createItem(46), createItem(38), createItem(24), createItem(29), createItem(11), createItem(7) ];
seria = new asc_CChartSeria(); seria.TxCache.Formula = "Sheet1!B1";
seria.Val.Formula = "Sheet1!C2:C7"; seria.TxCache.Tx = "Gold";
seria.Val.NumCache = [ createItem(29), createItem(27), createItem(26), createItem(17), createItem(19), createItem(14) ]; if (!bIsScatter)
seria.TxCache.Formula = "Sheet1!C1"; seria.Cat = Cat;
seria.TxCache.Tx = "Silver"; else
if (!bIsScatter) seria.xVal = Cat;
seria.Cat = Cat; series.push(seria);
else
seria.xVal = Cat; seria = new asc_CChartSeria();
series.push(seria); seria.Val.Formula = "Sheet1!C2:C7";
seria.Val.NumCache = [ createItem(29), createItem(27), createItem(26), createItem(17), createItem(19), createItem(14) ];
seria = new asc_CChartSeria(); seria.TxCache.Formula = "Sheet1!C1";
seria.Val.Formula = "Sheet1!D2:D7"; seria.TxCache.Tx = "Silver";
seria.Val.NumCache = [ createItem(29), createItem(23), createItem(32), createItem(19), createItem(14), createItem(17) ]; if (!bIsScatter)
seria.TxCache.Formula = "Sheet1!D1"; seria.Cat = Cat;
seria.TxCache.Tx = "Bronze"; else
if (!bIsScatter) seria.xVal = Cat;
seria.Cat = Cat; series.push(seria);
else
seria.xVal = Cat; seria = new asc_CChartSeria();
series.push(seria); seria.Val.Formula = "Sheet1!D2:D7";
seria.Val.NumCache = [ createItem(29), createItem(23), createItem(32), createItem(19), createItem(14), createItem(17) ];
return series; seria.TxCache.Formula = "Sheet1!D1";
seria.TxCache.Tx = "Bronze";
if (!bIsScatter)
seria.Cat = Cat;
else
seria.xVal = Cat;
series.push(seria);
return series;
}
else
{
Cat = { Formula: "Sheet1!A2:A5", NumCache: [createItem2(38719, "d\-mmm\-yy"), createItem2(38720, "d\-mmm\-yy"), createItem2(38721, "d\-mmm\-yy"), createItem2(38722, "d\-mmm\-yy"), createItem2(38723, "d\-mmm\-yy")], formatCode: "d\-mmm\-yy" };
seria = new asc_CChartSeria();
seria.Val.Formula = "Sheet1!B2:B5";
seria.Val.NumCache = [ createItem(40), createItem(21), createItem(37), createItem(49), createItem(32)];
seria.TxCache.Formula = "Sheet1!B1";
seria.TxCache.Tx = "Open";
seria.Cat = Cat;
series.push(seria);
seria = new asc_CChartSeria();
seria.Val.Formula = "Sheet1!C2:C5";
seria.Val.NumCache = [ createItem(57), createItem(54), createItem(52), createItem(59), createItem(34)];
seria.TxCache.Formula = "Sheet1!C1";
seria.TxCache.Tx = "High";
seria.Cat = Cat;
series.push(seria);
seria = new asc_CChartSeria();
seria.Val.Formula = "Sheet1!D2:D5";
seria.Val.NumCache = [ createItem(10), createItem(14), createItem(14), createItem(12), createItem(6)];
seria.TxCache.Formula = "Sheet1!D1";
seria.TxCache.Tx = "Low";
seria.Cat = Cat;
series.push(seria);
seria = new asc_CChartSeria();
seria.Val.Formula = "Sheet1!E2:E5";
seria.Val.NumCache = [ createItem(24), createItem(35), createItem(48), createItem(35), createItem(15)];
seria.TxCache.Formula = "Sheet1!E1";
seria.TxCache.Tx = "Close";
seria.Cat = Cat;
series.push(seria);
return series;
}
}, },
changeCurrentState: function(newState) changeCurrentState: function(newState)
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment