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 = ...@@ -6795,7 +6795,11 @@ CMarker.prototype =
} }
if(otherMarker.spPr.ln) 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() function CChartSpace()
{ {
this.chart = null; this.chart = null;
......
...@@ -11129,102 +11129,110 @@ var PARRUN_TYPE_BR = 3; ...@@ -11129,102 +11129,110 @@ var PARRUN_TYPE_BR = 3;
// DEFAULT OBJECTS // DEFAULT OBJECTS
function GenerateDefaultTheme(presentation) function GenerateDefaultTheme(presentation)
{ {
var theme = new CTheme(); return ExecuteNoHistory(function()
theme.presentation = presentation; {
theme.themeElements.fontScheme.majorFont.latin = "Arial"; var theme = new CTheme();
theme.themeElements.fontScheme.minorFont.latin = "Arial"; theme.presentation = presentation;
theme.themeElements.fontScheme.majorFont.latin = "Arial";
var scheme = theme.themeElements.clrScheme; theme.themeElements.fontScheme.minorFont.latin = "Arial";
scheme.colors[8] = CreateUniColorRGB(0,0,0); var scheme = theme.themeElements.clrScheme;
scheme.colors[12] = CreateUniColorRGB(255,255,255);
scheme.colors[9] = CreateUniColorRGB(0x1F,0x49, 0x7D); scheme.colors[8] = CreateUniColorRGB(0,0,0);
scheme.colors[13] = CreateUniColorRGB(0xEE,0xEC,0xE1); scheme.colors[12] = CreateUniColorRGB(255,255,255);
scheme.colors[0] = CreateUniColorRGB(0x4F, 0x81, 0xBD); //CreateUniColorRGB(0xFF, 0x81, 0xBD);// scheme.colors[9] = CreateUniColorRGB(0x1F,0x49, 0x7D);
scheme.colors[1] = CreateUniColorRGB(0xC0,0x50,0x4D); scheme.colors[13] = CreateUniColorRGB(0xEE,0xEC,0xE1);
scheme.colors[2] = CreateUniColorRGB(0x9B,0xBB,0x59); scheme.colors[0] = CreateUniColorRGB(0x4F, 0x81, 0xBD); //CreateUniColorRGB(0xFF, 0x81, 0xBD);//
scheme.colors[3] = CreateUniColorRGB(0x80,0x64,0xA2); scheme.colors[1] = CreateUniColorRGB(0xC0,0x50,0x4D);
scheme.colors[4] = CreateUniColorRGB(0x4B,0xAC,0xC6); scheme.colors[2] = CreateUniColorRGB(0x9B,0xBB,0x59);
scheme.colors[5] = CreateUniColorRGB(0xF7,0x96,0x46); scheme.colors[3] = CreateUniColorRGB(0x80,0x64,0xA2);
scheme.colors[11] = CreateUniColorRGB(0x00,0x00,0xFF); scheme.colors[4] = CreateUniColorRGB(0x4B,0xAC,0xC6);
scheme.colors[10] = CreateUniColorRGB(0x80, 0x00, 0x80); scheme.colors[5] = CreateUniColorRGB(0xF7,0x96,0x46);
scheme.colors[11] = CreateUniColorRGB(0x00,0x00,0xFF);
// -------------- fill styles ------------------------- scheme.colors[10] = CreateUniColorRGB(0x80, 0x00, 0x80);
var brush = new CUniFill();
brush.fill = new CSolidFill(); // -------------- fill styles -------------------------
brush.fill.color = new CUniColor(); var brush = new CUniFill();
brush.fill.color.color = new CSchemeColor(); brush.setFill(new CSolidFill());
brush.fill.color.color.id = phClr; brush.fill.setColor(new CUniColor());
theme.themeElements.fmtScheme.fillStyleLst.push(brush); brush.fill.color.setColor(new CSchemeColor());
brush.fill.color.color.setId(phClr);
brush = new CUniFill(); theme.themeElements.fmtScheme.fillStyleLst.push(brush);
brush.fill = new CSolidFill();
brush.fill.color = new CUniColor(); brush = new CUniFill();
brush.fill.color.color = CreateUniColorRGB(0,0,0);; brush.setFill(new CSolidFill());
theme.themeElements.fmtScheme.fillStyleLst.push(brush); brush.fill.setColor(new CUniColor());
brush.fill.color.setColor(CreateUniColorRGB(0,0,0));
brush = new CUniFill(); theme.themeElements.fmtScheme.fillStyleLst.push(brush);
brush.fill = new CSolidFill();
brush.fill.color = new CUniColor(); brush = new CUniFill();
brush.fill.color.color = CreateUniColorRGB(0,0,0);; brush.setFill(new CSolidFill());
theme.themeElements.fmtScheme.fillStyleLst.push(brush); 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(); // -------------- back styles -------------------------
brush.fill.color = new CUniColor(); brush = new CUniFill();
brush.fill.color.color = new CSchemeColor(); brush.setFill(new CSolidFill());
brush.fill.color.color.id = phClr; brush.fill.setColor(new CUniColor());
theme.themeElements.fmtScheme.bgFillStyleLst.push(brush); brush.fill.color.setColor(new CSchemeColor());
brush.fill.color.color.setId(phClr);
brush = new CUniFill(); theme.themeElements.fmtScheme.bgFillStyleLst.push(brush);
brush.fill = new CSolidFill();
brush.fill.color = new CUniColor(); brush = new CUniFill();
brush.fill.color.color = CreateUniColorRGB(0,0,0);; brush.setFill(new CSolidFill());
theme.themeElements.fmtScheme.bgFillStyleLst.push(brush); brush.fill.setColor(new CUniColor());
brush.fill.color.setColor(CreateUniColorRGB(0,0,0));
brush = new CUniFill(); theme.themeElements.fmtScheme.bgFillStyleLst.push(brush);
brush.fill = new CSolidFill();
brush.fill.color = new CUniColor(); brush = new CUniFill();
brush.fill.color.color = CreateUniColorRGB(0,0,0);; brush.setFill(new CSolidFill());
theme.themeElements.fmtScheme.bgFillStyleLst.push(brush); 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(); var pen = new CLn();
pen.Fill.fill = new CSolidFill(); pen.setW(9525);
pen.Fill.fill.color = new CUniColor(); pen.setFill(new CUniFill());
pen.Fill.fill.color.color = new CSchemeColor(); pen.Fill.setFill(new CSolidFill());
pen.Fill.fill.color.color.id = phClr; pen.Fill.fill.setColor(new CUniColor());
pen.Fill.fill.color.Mods = new CColorModifiers(); pen.Fill.fill.color.setColor(new CSchemeColor());
pen.Fill.fill.color.Mods.Mods.push({name: "shade", val:95000}); pen.Fill.fill.color.color.setId(phClr);
pen.Fill.fill.color.Mods.Mods.push({name: "satMod", val:105000}); pen.Fill.fill.color.setMods(new CColorModifiers());
theme.themeElements.fmtScheme.lnStyleLst.push(pen);
var mod = new CColorMod();
pen = new CLn(); mod.setName("shade");
pen.w = 25400; mod.setVal(95000);
pen.Fill = new CUniFill(); pen.Fill.fill.color.Mods.addMod(mod);
pen.Fill.fill = new CSolidFill(); mod = new CColorMod();
mod.setName("satMod");
pen.Fill.fill.color = new CUniColor(); mod.setVal(105000);
pen.Fill.fill.color.color = new CSchemeColor(); pen.Fill.fill.color.Mods.addMod(mod);
pen.Fill.fill.color.color.id = phClr; theme.themeElements.fmtScheme.lnStyleLst.push(pen);
theme.themeElements.fmtScheme.lnStyleLst.push(pen);
pen = new CLn();
pen = new CLn(); pen.setW(25400);
pen.w = 38100; pen.setFill(new CUniFill());
pen.Fill = new CUniFill(); pen.Fill.setFill(new CSolidFill());
pen.Fill.fill = new CSolidFill();
pen.Fill.fill.color = new CUniColor(); pen.Fill.fill.setColor(new CUniColor());
pen.Fill.fill.color.color = new CSchemeColor(); pen.Fill.fill.color.setColor(new CSchemeColor());
pen.Fill.fill.color.color.id = phClr; pen.Fill.fill.color.color.setId(phClr);
theme.themeElements.fmtScheme.lnStyleLst.push(pen); theme.themeElements.fmtScheme.lnStyleLst.push(pen);
theme.extraClrSchemeLst = []; pen = new CLn();
pen.setW(38100);
return theme; 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) function GenerateDefaultMasterSlide(theme)
......
...@@ -63,7 +63,11 @@ var MIN_ANGLE = 0.07; ...@@ -63,7 +63,11 @@ var MIN_ANGLE = 0.07;
function ExecuteNoHistory(f, oThis, args) 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) if(is_on)
{ {
History.TurnOff(); 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