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

расчет маркеров для точечных и линейных диаграмм

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53685 954022d7-b5bf-4e40-9824-e11837661b57
parent 1a32370f
......@@ -6795,7 +6795,11 @@ CMarker.prototype =
}
if(otherMarker.spPr.ln)
{
this.spPr.setLn(otherMarker.spPr.ln.createDuplicate());
if(!this.spPr.ln)
{
this.spPr.setLn(new CLn());
}
this.spPr.ln.merge(otherMarker.spPr.ln);
}
}
}
......
function CChartStyle()
var EFFECT_NONE = 0;
var EFFECT_SUBTLE = 1;
var EFFECT_MODERATE = 2;
var EFFECT_INTENSE = 3;
var CHART_STYLE_MANAGER = null;
function CreateUnifillSolidFillSchemeColorByIndex(index)
{
var ret = new CUniFill();
ret.setFill(new CSolidFill());
ret.fill.setColor(new CUniColor());
ret.fill.color.setColor(new CSchemeColor());
ret.fill.color.color.setId(index);
return ret;
}
function CChartStyleManager()
{
this.styles = [];
ExecuteNoHistory(
function()
{
var DefaultDataPointPerDataPoint =
[
[
CreateUniFillSchemeColorWidthTint(8, 0.885),
CreateUniFillSchemeColorWidthTint(8, 0.55),
CreateUniFillSchemeColorWidthTint(8, 0.78),
CreateUniFillSchemeColorWidthTint(8, 0.925),
CreateUniFillSchemeColorWidthTint(8, 0.7),
CreateUniFillSchemeColorWidthTint(8, 0.3)
],
[
CreateUniFillSchemeColorWidthTint(0, 0),
CreateUniFillSchemeColorWidthTint(1, 0),
CreateUniFillSchemeColorWidthTint(2, 0),
CreateUniFillSchemeColorWidthTint(3, 0),
CreateUniFillSchemeColorWidthTint(4, 0),
CreateUniFillSchemeColorWidthTint(5, 0)
],
[
CreateUniFillSchemeColorWidthTint(0, -0.5),
CreateUniFillSchemeColorWidthTint(1, -0.5),
CreateUniFillSchemeColorWidthTint(2, -0.5),
CreateUniFillSchemeColorWidthTint(3, -0.5),
CreateUniFillSchemeColorWidthTint(4, -0.5),
CreateUniFillSchemeColorWidthTint(5, -0.5)
],
[
CreateUniFillSchemeColorWidthTint(8, 0.05),
CreateUniFillSchemeColorWidthTint(8, 0.55),
CreateUniFillSchemeColorWidthTint(8, 0.78),
CreateUniFillSchemeColorWidthTint(8, 0.15),
CreateUniFillSchemeColorWidthTint(8, 0.7),
CreateUniFillSchemeColorWidthTint(8, 0.3)
]
];
var s = DefaultDataPointPerDataPoint;
var f = CreateUniFillSchemeColorWidthTint;
this.styles[0] = new CChartStyle(EFFECT_NONE, EFFECT_SUBTLE, s[0], EFFECT_SUBTLE, EFFECT_NONE, [], 3, s[0], 7);
this.styles[1] = new CChartStyle(EFFECT_NONE, EFFECT_SUBTLE, s[1], EFFECT_SUBTLE, EFFECT_NONE, [], 3, s[1], 7);
for(var i = 2; i < 8; ++i)
{
this.styles[i] = new CChartStyle(EFFECT_NONE, EFFECT_SUBTLE, [f(i - 2,0)], EFFECT_SUBTLE, EFFECT_NONE, [], 3, [f(i - 2,0)], 7);
}
this.styles[8] = new CChartStyle(EFFECT_SUBTLE, EFFECT_SUBTLE, s[0], EFFECT_SUBTLE, EFFECT_SUBTLE, [f(12,0)], 5, s[0], 9);
this.styles[9] = new CChartStyle(EFFECT_SUBTLE, EFFECT_SUBTLE, s[1], EFFECT_SUBTLE, EFFECT_SUBTLE, [f(12,0)], 5, s[1], 9);
for(i = 10; i < 16; ++i)
{
this.styles[i] = new CChartStyle(EFFECT_SUBTLE, EFFECT_SUBTLE, [f(i-10,0)], EFFECT_SUBTLE, EFFECT_SUBTLE, [f(12,0)], 5, [f(i-10,0)], 9);
}
this.styles[16] = new CChartStyle(EFFECT_MODERATE, EFFECT_INTENSE, s[0], EFFECT_SUBTLE, EFFECT_NONE, [], 5, s[0], 9);
this.styles[17] = new CChartStyle(EFFECT_MODERATE, EFFECT_INTENSE, s[1], EFFECT_INTENSE, EFFECT_NONE, [], 5, s[1], 9);
for(i = 18; i < 24; ++i)
{
this.styles[i] = new CChartStyle(EFFECT_MODERATE, EFFECT_INTENSE, [f(i-18,0)], EFFECT_SUBTLE, EFFECT_NONE, [], 5, [f(i-18,0)], 9);
}
this.styles[24] = new CChartStyle(EFFECT_INTENSE, EFFECT_INTENSE, s[0], EFFECT_SUBTLE, EFFECT_NONE, [], 7, s[0], 13);
this.styles[25] = new CChartStyle(EFFECT_MODERATE, EFFECT_INTENSE, s[1], EFFECT_SUBTLE, EFFECT_NONE, [], 7, s[1], 13);
for(i = 26; i < 32; ++i)
{
this.styles[i] = new CChartStyle(EFFECT_MODERATE, EFFECT_INTENSE, [f(i-27,0)], EFFECT_SUBTLE, EFFECT_NONE, [], 7, s[1], 13);
}
this.styles[32] = new CChartStyle(EFFECT_NONE, EFFECT_SUBTLE, s[0], EFFECT_SUBTLE, EFFECT_SUBTLE, [f(8, -0.5)], 5, s[0], 9);
this.styles[33] = new CChartStyle(EFFECT_NONE, EFFECT_SUBTLE, s[1], EFFECT_SUBTLE, EFFECT_SUBTLE, s[2], 5, s[1], 9);
for(i = 34; i < 41; ++i)
{
this.styles[i] = new CChartStyle(EFFECT_NONE, EFFECT_SUBTLE, [f(i - 34, 0)], EFFECT_SUBTLE, EFFECT_SUBTLE, [f(i-34, -0.5)], 5, [f(i-34, 0)], 9);
}
this.styles[41] = new CChartStyle(EFFECT_INTENSE, EFFECT_INTENSE, s[3], EFFECT_SUBTLE, EFFECT_NONE, [], 5, s[3], 9);
this.styles[42] = new CChartStyle(EFFECT_INTENSE, EFFECT_INTENSE, s[1], EFFECT_INTENSE, EFFECT_NONE, [], 5, s[1], 9);
for(i = 43; i < 48; ++i)
{
this.styles[i] = new CChartStyle(EFFECT_INTENSE, EFFECT_INTENSE, [f(i-43, 0)], EFFECT_SUBTLE, EFFECT_NONE, [], 5, [f(i-43, 0)], 9);
}
},
this, []);
}
CChartStyleManager.prototype =
{
getStyleByIndex: function(index)
{
if(isRealNumber(index))
{
return this.styles[(index - 1) % 48];
}
return this.styles[1];
}
};
function CChartStyle(effect, fill1, fill2, fill3, line1, line2, line3, line4, markerSize)
{
this.effect = effect;
this.fill1 = fill1;
this.fill2 = fill2;
this.fill3 = fill3;
this.line1 = line1;
this.line2 = line2;
this.line3 = line3;
this.line4 = line4;
this.markerSize = markerSize;
}
function CreateUniFillSchemeColorWidthTint(schemeColorId, tintVal)
{
return ExecuteNoHistory(
function(schemeColorId, tintVal)
{
return CreateUniFillSolidFillWidthTintOrShade(CreateUnifillSolidFillSchemeColorByIndex(schemeColorId), tintVal);
},
this, [schemeColorId, tintVal]);
}
function CChartSpace()
{
......
......@@ -11129,6 +11129,8 @@ var PARRUN_TYPE_BR = 3;
// DEFAULT OBJECTS
function GenerateDefaultTheme(presentation)
{
return ExecuteNoHistory(function()
{
var theme = new CTheme();
theme.presentation = presentation;
theme.themeElements.fontScheme.majorFont.latin = "Arial";
......@@ -11151,80 +11153,86 @@ function GenerateDefaultTheme(presentation)
// -------------- fill styles -------------------------
var brush = new CUniFill();
brush.fill = new CSolidFill();
brush.fill.color = new CUniColor();
brush.fill.color.color = new CSchemeColor();
brush.fill.color.color.id = phClr;
brush.setFill(new CSolidFill());
brush.fill.setColor(new CUniColor());
brush.fill.color.setColor(new CSchemeColor());
brush.fill.color.color.setId(phClr);
theme.themeElements.fmtScheme.fillStyleLst.push(brush);
brush = new CUniFill();
brush.fill = new CSolidFill();
brush.fill.color = new CUniColor();
brush.fill.color.color = CreateUniColorRGB(0,0,0);;
brush.setFill(new CSolidFill());
brush.fill.setColor(new CUniColor());
brush.fill.color.setColor(CreateUniColorRGB(0,0,0));
theme.themeElements.fmtScheme.fillStyleLst.push(brush);
brush = new CUniFill();
brush.fill = new CSolidFill();
brush.fill.color = new CUniColor();
brush.fill.color.color = CreateUniColorRGB(0,0,0);;
brush.setFill(new CSolidFill());
brush.fill.setColor(new CUniColor());
brush.fill.color.setColor(CreateUniColorRGB(0,0,0));
theme.themeElements.fmtScheme.fillStyleLst.push(brush);
// ----------------------------------------------------
// -------------- back styles -------------------------
brush = new CUniFill();
brush.fill = new CSolidFill();
brush.fill.color = new CUniColor();
brush.fill.color.color = new CSchemeColor();
brush.fill.color.color.id = phClr;
brush.setFill(new CSolidFill());
brush.fill.setColor(new CUniColor());
brush.fill.color.setColor(new CSchemeColor());
brush.fill.color.color.setId(phClr);
theme.themeElements.fmtScheme.bgFillStyleLst.push(brush);
brush = new CUniFill();
brush.fill = new CSolidFill();
brush.fill.color = new CUniColor();
brush.fill.color.color = CreateUniColorRGB(0,0,0);;
brush.setFill(new CSolidFill());
brush.fill.setColor(new CUniColor());
brush.fill.color.setColor(CreateUniColorRGB(0,0,0));
theme.themeElements.fmtScheme.bgFillStyleLst.push(brush);
brush = new CUniFill();
brush.fill = new CSolidFill();
brush.fill.color = new CUniColor();
brush.fill.color.color = CreateUniColorRGB(0,0,0);;
brush.setFill(new CSolidFill());
brush.fill.setColor(new CUniColor());
brush.fill.color.setColor(CreateUniColorRGB(0,0,0));
theme.themeElements.fmtScheme.bgFillStyleLst.push(brush);
// ----------------------------------------------------
var pen = new CLn();
pen.w = 9525;
pen.Fill = new CUniFill();
pen.Fill.fill = new CSolidFill();
pen.Fill.fill.color = new CUniColor();
pen.Fill.fill.color.color = new CSchemeColor();
pen.Fill.fill.color.color.id = phClr;
pen.Fill.fill.color.Mods = new CColorModifiers();
pen.Fill.fill.color.Mods.Mods.push({name: "shade", val:95000});
pen.Fill.fill.color.Mods.Mods.push({name: "satMod", val:105000});
pen.setW(9525);
pen.setFill(new CUniFill());
pen.Fill.setFill(new CSolidFill());
pen.Fill.fill.setColor(new CUniColor());
pen.Fill.fill.color.setColor(new CSchemeColor());
pen.Fill.fill.color.color.setId(phClr);
pen.Fill.fill.color.setMods(new CColorModifiers());
var mod = new CColorMod();
mod.setName("shade");
mod.setVal(95000);
pen.Fill.fill.color.Mods.addMod(mod);
mod = new CColorMod();
mod.setName("satMod");
mod.setVal(105000);
pen.Fill.fill.color.Mods.addMod(mod);
theme.themeElements.fmtScheme.lnStyleLst.push(pen);
pen = new CLn();
pen.w = 25400;
pen.Fill = new CUniFill();
pen.Fill.fill = new CSolidFill();
pen.setW(25400);
pen.setFill(new CUniFill());
pen.Fill.setFill(new CSolidFill());
pen.Fill.fill.color = new CUniColor();
pen.Fill.fill.color.color = new CSchemeColor();
pen.Fill.fill.color.color.id = phClr;
pen.Fill.fill.setColor(new CUniColor());
pen.Fill.fill.color.setColor(new CSchemeColor());
pen.Fill.fill.color.color.setId(phClr);
theme.themeElements.fmtScheme.lnStyleLst.push(pen);
pen = new CLn();
pen.w = 38100;
pen.Fill = new CUniFill();
pen.Fill.fill = new CSolidFill();
pen.Fill.fill.color = new CUniColor();
pen.Fill.fill.color.color = new CSchemeColor();
pen.Fill.fill.color.color.id = phClr;
pen.setW(38100);
pen.setFill(new CUniFill());
pen.Fill.setFill(new CSolidFill());
pen.Fill.fill.setColor(new CUniColor());
pen.Fill.fill.color.setColor(new CSchemeColor());
pen.Fill.fill.color.color.setId(phClr);
theme.themeElements.fmtScheme.lnStyleLst.push(pen);
theme.extraClrSchemeLst = [];
return theme;
}, this, []);
}
function GenerateDefaultMasterSlide(theme)
......
......@@ -63,7 +63,11 @@ var MIN_ANGLE = 0.07;
function ExecuteNoHistory(f, oThis, args)
{
var is_on = History.Is_On();
var is_on = (History instanceof CHistory) ? History.Is_On() : false;
if(!(History instanceof CHistory))
{
History = {Add: function(){}};
}
if(is_on)
{
History.TurnOff();
......
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