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

Чёткие маркеры в диаграммах; Получение дефолтовых подписей для диаграмм из...

Чёткие маркеры в диаграммах; Получение дефолтовых подписей для диаграмм из ChartTranslateManager'а. Подсказки для гиперссылок в автофигурах. Исправлен неправильный расчет заливок и линий для маркеров в легенде диаграмм типа Pie и кольцевой.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57231 954022d7-b5bf-4e40-9824-e11837661b57
parent edaa22da
......@@ -487,6 +487,17 @@ DrawingObjectsController.prototype =
}
else
{
if(this.document)
{
var content = object.getDocContent();
var invert_transform_text = object.invertTransformText, tx, ty;
if(content && invert_transform_text)
{
tx = invert_transform_text.TransformPointX(x, y);
ty = invert_transform_text.TransformPointY(x, y);
content.Update_CursorType(tx, ty, pageIndex);
}
}
return {objectId: object.Get_Id(), cursorType: "text"};
}
},
......
......@@ -3385,7 +3385,7 @@ CAreaSeries.prototype =
return this.tx.strRef.strCache.pt[0].val;
}
}
return "Series " + (this.idx + 1) ;
return getChartTranslateManager().asc_getSeries() + " " + (this.idx + 1) ;
},
getCatName: function(idx)
......@@ -13102,26 +13102,13 @@ CLegend.prototype =
},
draw: function(g)
{
if(this.chart)
{
CShape.prototype.draw.call(this, g);/*
g.SetIntegerGrid(false);
g.p_width(70);
g.transform3(this.chart.transform, false);
g.p_color(0, 0, 0, 255);
g._s();
g._m(this.x, this.y);
g._l(this.x + this.extX, this.y + 0);
g._l(this.x + this.extX, this.y + this.extY);
g._l(this.x + 0, this.y + this.extY);
g._z();
g.ds();
g.SetIntegerGrid(true); */
}
g.bDrawSmart = true;
CShape.prototype.draw.call(this, g);
for(var i = 0; i < this.calcEntryes.length; ++i)
{
this.calcEntryes[i].draw(g);
}
g.bDrawSmart = false;
},
setPosition: function(x, y)
......@@ -21883,15 +21870,25 @@ CTitle.prototype =
getDefaultTextForTxBody: function()
{
//TODO: продумать с переводом
if(this.parent instanceof CChart)
if(this.parent)
{
return "Chart Title";
if(this.parent.getObjectType() === historyitem_type_Chart)
{
return getChartTranslateManager().asc_getTitle();
}
else
{
return "Axis Title";
if(this.parent.axPos === AX_POS_B || this.parent.axPos === AX_POS_T)
{
return getChartTranslateManager().asc_getXAxis();
}
else
{
return getChartTranslateManager().asc_getYAxis();
}
}
}
return "Axis Title";
},
getStyles: CDLbl.prototype.getStyles,
......@@ -24050,6 +24047,7 @@ CalcLegendEntry.prototype =
draw: function(g)
{
CShape.prototype.draw.call(this, g);
if(this.calcMarkerUnion)
this.calcMarkerUnion.draw(g);
......
......@@ -5341,8 +5341,8 @@ CChartSpace.prototype =
else
{
union_marker.marker = CreateMarkerGeometryByType(SYMBOL_SQUARE, null);
union_marker.marker.pen = pt.compiledMarker.pen;
union_marker.marker.brush = pt.compiledMarker.brush;
union_marker.marker.pen = pt.pen;
union_marker.marker.brush = pt.brush;
}
if(union_marker.marker)
{
......@@ -7352,149 +7352,6 @@ CChartSpace.prototype =
}
}
}
/*if(this.chart.plotArea.chart.getObjectType() !== historyitem_type_LineChart && this.chart.plotArea.chart.getObjectType() !== historyitem_type_RadarChart || this.chart.plotArea.chart.marker)
{
var chart_style = CHART_STYLE_MANAGER.getStyleByIndex(this.style);
var effect_fill = chart_style.fill1;
var fill = chart_style.fill2;
var line = chart_style.line4;
var masrker_default_size = chart_style.markerSize;
var default_marker = new CMarker();
default_marker.setSize(masrker_default_size);
var parent_objects = this.getParentObjects();
if(parent_objects.theme && parent_objects.theme.themeElements
&& parent_objects.theme.themeElements.fmtScheme
&& parent_objects.theme.themeElements.fmtScheme.lnStyleLst)
{
default_marker.setSpPr(new CSpPr());
default_marker.spPr.setLn(new CLn());
default_marker.spPr.ln.merge(parent_objects.theme.themeElements.fmtScheme.lnStyleLst[0]);
}
var RGBA = {R:0, G:0, B:0, A: 255};
if(this.chart.plotArea.chart.varyColors && (this.chart.plotArea.chart.series.length === 1 || this.chart.plotArea.chart.getObjectType() === historyitem_type_PieChart || this.chart.plotArea.chart.getObjectType() === historyitem_type_DoughnutChart))
{
var ser = this.chart.plotArea.chart.series[0], pts;
pts = getPtsFromSeries(ser);
var series_marker = ser.marker;
var brushes = getArrayFillsFromBase(fill, getMaxIdx(pts));
var pens_fills = getArrayFillsFromBase(line, getMaxIdx(pts));
var compiled_markers = [];
for(var i = 0; i < pts.length; ++i)
{
var compiled_marker = new CMarker();
compiled_marker.merge(default_marker);
if(!compiled_marker.spPr)
{
compiled_marker.setSpPr(new CSpPr());
}
compiled_marker.spPr.setFill(brushes[pts[i].idx]);
compiled_marker.spPr.Fill.merge(pts[i].brush);
if(!compiled_marker.spPr.ln)
compiled_marker.spPr.setLn(new CLn());
compiled_marker.spPr.ln.merge(pts[i].pen);
compiled_marker.merge(ser.marker);
compiled_marker.setSymbol(GetTypeMarkerByIndex(j));
if(Array.isArray(ser.dPt))
{
for(var j = 0; j < ser.dPt.length; ++j)
{
if(ser.dPt[j].idx === pts[i].idx)
{
var d_pt = ser.dPt[j];
if(d_pt.spPr && (d_pt.spPr.Fill || d_pt.spPr.ln))
{
if(!compiled_marker.spPr)
{
compiled_marker.setSpPr(new CSpPr());
}
if(d_pt.spPr.Fill)
{
compiled_marker.spPr.setFill(d_pt.spPr.Fill.createDuplicate());
}
if(d_pt.spPr.ln)
{
if(!compiled_marker.spPr.ln)
{
compiled_marker.spPr.setLn(new CLn());
}
compiled_marker.spPr.ln.merge(d_pt.spPr.ln);
}
}
compiled_marker.merge(ser.dPt[j].marker);
break;
}
}
}
pts[i].compiledMarker = compiled_marker;
pts[i].compiledMarker.pen = compiled_marker.spPr.ln;
pts[i].compiledMarker.brush = compiled_marker.spPr.Fill;
pts[i].compiledMarker.brush.calculate(parent_objects.theme, parent_objects.slide, parent_objects.layout, parent_objects.master, RGBA);
pts[i].compiledMarker.pen.calculate(parent_objects.theme, parent_objects.slide, parent_objects.layout, parent_objects.master, RGBA);
}
}
else
{
var series = this.chart.plotArea.chart.series;
var brushes = getArrayFillsFromBase(fill, getMaxIdx(series));
var pens_fills = getArrayFillsFromBase(line, getMaxIdx(series));
for(var i = 0; i < series.length; ++i)
{
var ser = series[i];
pts = getPtsFromSeries(ser);
for(var j = 0; j < pts.length; ++j)
{
var compiled_marker = new CMarker();
compiled_marker.merge(default_marker);
if(!compiled_marker.spPr)
{
compiled_marker.setSpPr(new CSpPr());
}
compiled_marker.spPr.setFill(brushes[series[i].idx]);
if(!compiled_marker.spPr.ln)
compiled_marker.spPr.setLn(new CLn());
compiled_marker.spPr.ln.setFill(pens_fills[series[i].idx]);
compiled_marker.setSymbol(GetTypeMarkerByIndex(series[i].idx));
compiled_marker.merge(ser.marker);
if(j === 0)
ser.compiledSeriesMarker = compiled_marker.createDuplicate();
if(Array.isArray(ser.dPt))
{
for(var k = 0; k < ser.dPt.length; ++k)
{
if(ser.dPt[k].idx === pts[j].idx)
{
compiled_marker.merge(ser.dPt[k].marker);
break;
}
}
}
pts[j].compiledMarker = compiled_marker;
pts[j].compiledMarker.pen = compiled_marker.spPr.ln;
pts[j].compiledMarker.brush = compiled_marker.spPr.Fill;
pts[j].compiledMarker.brush.calculate(parent_objects.theme, parent_objects.slide, parent_objects.layout, parent_objects.master, RGBA);
pts[j].compiledMarker.pen.calculate(parent_objects.theme, parent_objects.slide, parent_objects.layout, parent_objects.master, RGBA);
}
}
}
}
else
{
var series = this.chart.plotArea.chart.series;
for(var i = 0; i < series.length; ++i)
{
var ser = series[i];
ser.compiledSeriesMarker = null;
pts = getPtsFromSeries(ser);
for(var j = 0; j < pts.length; ++j)
{
pts[j].compiledMarker = null;
}
}
} */
},
recalculateGridLines: function()
......
......@@ -1032,6 +1032,8 @@ Geometry.prototype=
draw: function(shape_drawer)
{
if(shape_drawer.Graphics && shape_drawer.Graphics.bDrawSmart)
this.drawSmart(shape_drawer);
for (var i=0, n=this.pathLst.length; i<n;++i)
this.pathLst[i].draw(shape_drawer);
},
......
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