Commit d1a54e09 authored by Sergey Luzyanin's avatar Sergey Luzyanin

Methods for a setting gridlines visual properties, method for changing axis labels font size.

parent f7d09b33
......@@ -1043,6 +1043,61 @@
AscFormat.builder_SetChartHorAxisTickLablePosition(this.Chart, sTickLabelPosition);
};
/**
* Specifies major vertical gridline's visual properties
* @param {?ApiStroke} oStroke
* */
ApiChart.prototype.SetMajorVerticalGridlines = function(oStroke)
{
AscFormat.builder_SetVerAxisMajorGridlines(this.Chart, oStroke ? oStroke.Ln : null);
};
/**
* Specifies minor vertical gridline's visual properties
* @param {?ApiStroke} oStroke
* */
ApiChart.prototype.SetMinorVerticalGridlines = function(oStroke)
{
AscFormat.builder_SetVerAxisMinorGridlines(this.Chart, oStroke ? oStroke.Ln : null);
};
/**
* Specifies major horizontal gridline's visual properties
* @param {?ApiStroke} oStroke
* */
ApiChart.prototype.SetMajorHorizontalGridlines = function(oStroke)
{
AscFormat.builder_SetHorAxisMajorGridlines(this.Chart, oStroke ? oStroke.Ln : null);
};
/**
* Specifies minor vertical gridline's visual properties
* @param {?ApiStroke} oStroke
*/
ApiChart.prototype.SetMinorHorizontalGridlines = function(oStroke)
{
AscFormat.builder_SetHorAxisMinorGridlines(this.Chart, oStroke ? oStroke.Ln : null);
};
/**
* Specifies font size for labels of horizontal axis
* @param {number} nFontSize
*/
ApiChart.prototype.SetHorAxisLablesFontSize = function(nFontSize){
AscFormat.builder_SetHorAxisFontSize(this.Chart, nFontSize);
};
/**
* Specifies font size for labels of vertical axis
* @param {number} nFontSize
*/
ApiChart.prototype.SetVertAxisLablesFontSize = function(nFontSize){
AscFormat.builder_SetVerAxisFontSize(this.Chart, nFontSize);
};
/**
* Get the type of this class.
* @returns {"color"}
......@@ -1119,7 +1174,16 @@
ApiChart.prototype["SetVertAxisMinorTickMark"] = ApiChart.prototype.SetVertAxisMinorTickMark;
ApiColor.prototype["GetClassType"] = ApiColor.prototype.GetClassType;
ApiChart.prototype["SetMajorVerticalGridlines"] = ApiChart.prototype.SetMajorVerticalGridlines;
ApiChart.prototype["SetMinorVerticalGridlines"] = ApiChart.prototype.SetMinorVerticalGridlines;
ApiChart.prototype["SetMajorHorizontalGridlines"] = ApiChart.prototype.SetMajorHorizontalGridlines;
ApiChart.prototype["SetMinorHorizontalGridlines"] = ApiChart.prototype.SetMinorHorizontalGridlines;
ApiChart.prototype["SetHorAxisLablesFontSize"] = ApiChart.prototype.SetHorAxisLablesFontSize;
ApiChart.prototype["SetVertAxisLablesFontSize"] = ApiChart.prototype.SetVertAxisLablesFontSize;
ApiColor.prototype["GetClassType"] = ApiColor.prototype.GetClassType;
function private_SetCoords(oDrawing, oWorksheet, nExtX, nExtY, nFromCol, nColOffset, nFromRow, nRowOffset){
......
......@@ -9999,8 +9999,7 @@ function CorrectUniColor(asc_color, unicolor, flag)
}
}
function builder_SetChartVertAxisOrientation(oChartSpace, bIsMinMax) {
function builder_SetChartVertAxisOrientation(oChartSpace, bIsMinMax) {
if(oChartSpace){
var verAxis = oChartSpace.chart.plotArea.getVerticalAxis();
if(verAxis)
......@@ -10018,7 +10017,6 @@ function CorrectUniColor(asc_color, unicolor, flag)
}
}
function builder_SetChartHorAxisOrientation(oChartSpace, bIsMinMax){
if(oChartSpace){
var horAxis = oChartSpace.chart.plotArea.getHorizontalAxis();
......@@ -10090,28 +10088,40 @@ function CorrectUniColor(asc_color, unicolor, flag)
}
}
function builder_SetLegendFontSize(oChartSpace, nFontSize){
var oLegend = oChartSpace.chart.legend;
if(oLegend){
if(!oLegend.txPr)
{
oLegend.setTxPr(new AscFormat.CTextBody());
}
if(!oLegend.txPr.bodyPr)
{
oLegend.txPr.setBodyPr(new AscFormat.CBodyPr());
}
if(!oLegend.txPr.content)
{
oLegend.txPr.setContent(new AscFormat.CDrawingDocContent(oLegend.txPr, oChartSpace.getDrawingDocument(), 0, 0, 100, 500, false, false, true));
}
var oPr = oLegend.txPr.content.Content[0].Pr.Copy();
if(!oPr.DefaultRunPr){
oPr.DefaultRunPr = new AscCommonWord.CTextPr();
}
oPr.DefaultRunPr.FontSize = nFontSize;
oLegend.txPr.content.Content[0].Set_Pr(oPr);
function builder_SetObjectFontSize(oObject, nFontSize, oDrawingDocument){
if(!oObject){
return;
}
if(!oObject.txPr)
{
oObject.setTxPr(new AscFormat.CTextBody());
}
if(!oObject.txPr.bodyPr)
{
oObject.txPr.setBodyPr(new AscFormat.CBodyPr());
}
if(!oObject.txPr.content)
{
oObject.txPr.setContent(new AscFormat.CDrawingDocContent(oObject.txPr, oDrawingDocument, 0, 0, 100, 500, false, false, true));
}
var oPr = oObject.txPr.content.Content[0].Pr.Copy();
if(!oPr.DefaultRunPr){
oPr.DefaultRunPr = new AscCommonWord.CTextPr();
}
oPr.DefaultRunPr.FontSize = nFontSize;
oObject.txPr.content.Content[0].Set_Pr(oPr);
}
function builder_SetLegendFontSize(oChartSpace, nFontSize){
builder_SetObjectFontSize(oChartSpace.chart.legend, nFontSize, oChartSpace.getDrawingDocument());
}
function builder_SetHorAxisFontSize(oChartSpace, nFontSize){
builder_SetObjectFontSize(oChartSpace.chart.plotArea.getHorizontalAxis(), nFontSize, oChartSpace.getDrawingDocument());
}
function builder_SetVerAxisFontSize(oChartSpace, nFontSize){
builder_SetObjectFontSize(oChartSpace.chart.plotArea.getVerticalAxis(), nFontSize, oChartSpace.getDrawingDocument());
}
function builder_SetShowDataLabels(oChartSpace, bShowSerName, bShowCatName, bShowVal, bShowPerecent){
......@@ -10142,7 +10152,6 @@ function CorrectUniColor(asc_color, unicolor, flag)
}
}
function builder_SetChartAxisLabelsPos(oAxis, sPosition){
if(!oAxis || !oAxis.setTickLblPos){
return;
......@@ -10177,13 +10186,13 @@ function CorrectUniColor(asc_color, unicolor, flag)
builder_SetChartAxisLabelsPos(oChartSpace.chart.plotArea.getVerticalAxis(), sPosition);
}
}
function builder_SetChartHorAxisTickLablePosition(oChartSpace, sPosition){
if(oChartSpace){
builder_SetChartAxisLabelsPos(oChartSpace.chart.plotArea.getHorizontalAxis(), sPosition);
}
}
function builder_GetTickMark(sTickMark){
var nNewTickMark = null;
switch(sTickMark){
......@@ -10220,6 +10229,7 @@ function CorrectUniColor(asc_color, unicolor, flag)
oAxis.setMajorTickMark(nNewTickMark);
}
}
function builder_SetChartAxisMinorTickMark(oAxis, sTickMark){
if(!oAxis){
return;
......@@ -10235,6 +10245,7 @@ function CorrectUniColor(asc_color, unicolor, flag)
builder_SetChartAxisMajorTickMark(oChartSpace.chart.plotArea.getHorizontalAxis(), sTickMark);
}
}
function builder_SetChartHorAxisMinorTickMark(oChartSpace, sTickMark){
if(oChartSpace){
builder_SetChartAxisMinorTickMark(oChartSpace.chart.plotArea.getHorizontalAxis(), sTickMark);
......@@ -10246,12 +10257,48 @@ function CorrectUniColor(asc_color, unicolor, flag)
builder_SetChartAxisMajorTickMark(oChartSpace.chart.plotArea.getVerticalAxis(), sTickMark);
}
}
function builder_SetChartVerAxisMinorTickMark(oChartSpace, sTickMark){
if(oChartSpace){
builder_SetChartAxisMinorTickMark(oChartSpace.chart.plotArea.getVerticalAxis(), sTickMark);
}
}
function builder_SetAxisMajorGridlines(oAxis, oLn){
if(oAxis){
if(!oAxis.majorGridlines){
oAxis.setMajorGridlines(new AscFormat.CSpPr());
}
oAxis.majorGridlines.setLn(oLn);
if(!oAxis.majorGridlines.Fill && !oAxis.majorGridlines.ln){
oAxis.setMajorGridlines(null);
}
}
}
function builder_SetAxisMinorGridlines(oAxis, oLn){
if(oAxis){
if(!oAxis.minorGridlines){
oAxis.setMinorGridlines(new AscFormat.CSpPr());
}
oAxis.minorGridlines.setLn(oLn);
if(!oAxis.minorGridlines.Fill && !oAxis.minorGridlines.ln){
oAxis.setMinorGridlines(null);
}
}
}
function builder_SetHorAxisMajorGridlines(oChartSpace, oLn){
builder_SetAxisMajorGridlines(oChartSpace.chart.plotArea.getVerticalAxis(), oLn);
}
function builder_SetHorAxisMinorGridlines(oChartSpace, oLn){
builder_SetAxisMinorGridlines(oChartSpace.chart.plotArea.getVerticalAxis(), oLn);
}
function builder_SetVerAxisMajorGridlines(oChartSpace, oLn){
builder_SetAxisMajorGridlines(oChartSpace.chart.plotArea.getHorizontalAxis(), oLn);
}
function builder_SetVerAxisMinorGridlines(oChartSpace, oLn){
builder_SetAxisMinorGridlines(oChartSpace.chart.plotArea.getHorizontalAxis(), oLn);
}
//----------------------------------------------------------export----------------------------------------------------
window['AscFormat'] = window['AscFormat'] || {};
......@@ -10380,6 +10427,12 @@ function CorrectUniColor(asc_color, unicolor, flag)
window['AscFormat'].builder_SetChartVerAxisMajorTickMark = builder_SetChartVerAxisMajorTickMark;
window['AscFormat'].builder_SetChartVerAxisMinorTickMark = builder_SetChartVerAxisMinorTickMark;
window['AscFormat'].builder_SetLegendFontSize = builder_SetLegendFontSize;
window['AscFormat'].builder_SetHorAxisMajorGridlines = builder_SetHorAxisMajorGridlines;
window['AscFormat'].builder_SetHorAxisMinorGridlines = builder_SetHorAxisMinorGridlines;
window['AscFormat'].builder_SetVerAxisMajorGridlines = builder_SetVerAxisMajorGridlines;
window['AscFormat'].builder_SetVerAxisMinorGridlines = builder_SetVerAxisMinorGridlines;
window['AscFormat'].builder_SetHorAxisFontSize = builder_SetHorAxisFontSize;
window['AscFormat'].builder_SetVerAxisFontSize = builder_SetVerAxisFontSize;
......
......@@ -765,6 +765,62 @@
/**
* Specifies major vertical gridline's visual properties
* @param {?ApiStroke} oStroke
* */
ApiChart.prototype.SetMajorVerticalGridlines = function(oStroke)
{
AscFormat.builder_SetVerAxisMajorGridlines(this.Chart, oStroke ? oStroke.Ln : null);
};
/**
* Specifies minor vertical gridline's visual properties
* @param {?ApiStroke} oStroke
* */
ApiChart.prototype.SetMinorVerticalGridlines = function(oStroke)
{
AscFormat.builder_SetVerAxisMinorGridlines(this.Chart, oStroke ? oStroke.Ln : null);
};
/**
* Specifies major horizontal gridline's visual properties
* @param {?ApiStroke} oStroke
* */
ApiChart.prototype.SetMajorHorizontalGridlines = function(oStroke)
{
AscFormat.builder_SetHorAxisMajorGridlines(this.Chart, oStroke ? oStroke.Ln : null);
};
/**
* Specifies minor vertical gridline's visual properties
* @param {?ApiStroke} oStroke
* */
ApiChart.prototype.SetMinorHorizontalGridlines = function(oStroke)
{
AscFormat.builder_SetHorAxisMinorGridlines(this.Chart, oStroke ? oStroke.Ln : null);
};
/**
* Specifies font size for labels of horizontal axis
* @param {number} nFontSize
*/
ApiChart.prototype.SetHorAxisLablesFontSize = function(nFontSize){
AscFormat.builder_SetHorAxisFontSize(this.Chart, nFontSize);
};
/**
* Specifies font size for labels of vertical axis
* @param {number} nFontSize
*/
ApiChart.prototype.SetVertAxisLablesFontSize = function(nFontSize){
AscFormat.builder_SetVerAxisFontSize(this.Chart, nFontSize);
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Export
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
......@@ -817,6 +873,12 @@
ApiChart.prototype["SetHorAxisMinorTickMark"] = ApiChart.prototype.SetHorAxisMinorTickMark;
ApiChart.prototype["SetVertAxisMajorTickMark"] = ApiChart.prototype.SetVertAxisMajorTickMark;
ApiChart.prototype["SetVertAxisMinorTickMark"] = ApiChart.prototype.SetVertAxisMinorTickMark;
ApiChart.prototype["SetMajorVerticalGridlines"] = ApiChart.prototype.SetMajorVerticalGridlines;
ApiChart.prototype["SetMinorVerticalGridlines"] = ApiChart.prototype.SetMinorVerticalGridlines;
ApiChart.prototype["SetMajorHorizontalGridlines"] = ApiChart.prototype.SetMajorHorizontalGridlines;
ApiChart.prototype["SetMinorHorizontalGridlines"] = ApiChart.prototype.SetMinorHorizontalGridlines;
ApiChart.prototype["SetHorAxisLablesFontSize"] = ApiChart.prototype.SetHorAxisLablesFontSize;
ApiChart.prototype["SetVertAxisLablesFontSize"] = ApiChart.prototype.SetVertAxisLablesFontSize;
function private_GetCurrentSlide(){
var oApiPresentation = editor.GetPresentation();
......
......@@ -4127,6 +4127,62 @@
};
/**
* Specifies major vertical gridline's visual properties
* @param {?ApiStroke} oStroke
* */
ApiChart.prototype.SetMajorVerticalGridlines = function(oStroke)
{
AscFormat.builder_SetVerAxisMajorGridlines(this.Chart, oStroke ? oStroke.Ln : null);
};
/**
* Specifies minor vertical gridline's visual properties
* @param {?ApiStroke} oStroke
* */
ApiChart.prototype.SetMinorVerticalGridlines = function(oStroke)
{
AscFormat.builder_SetVerAxisMinorGridlines(this.Chart, oStroke ? oStroke.Ln : null);
};
/**
* Specifies major horizontal gridline's visual properties
* @param {?ApiStroke} oStroke
* */
ApiChart.prototype.SetMajorHorizontalGridlines = function(oStroke)
{
AscFormat.builder_SetHorAxisMajorGridlines(this.Chart, oStroke ? oStroke.Ln : null);
};
/**
* Specifies minor vertical gridline's visual properties
* @param {?ApiStroke} oStroke
* */
ApiChart.prototype.SetMinorHorizontalGridlines = function(oStroke)
{
AscFormat.builder_SetHorAxisMinorGridlines(this.Chart, oStroke ? oStroke.Ln : null);
};
/**
* Specifies font size for labels of horizontal axis
* @param {number} nFontSize
*/
ApiChart.prototype.SetHorAxisLablesFontSize = function(nFontSize){
AscFormat.builder_SetHorAxisFontSize(this.Chart, nFontSize);
};
/**
* Specifies font size for labels of vertical axis
* @param {number} nFontSize
*/
ApiChart.prototype.SetVertAxisLablesFontSize = function(nFontSize){
AscFormat.builder_SetVerAxisFontSize(this.Chart, nFontSize);
};
//------------------------------------------------------------------------------------------------------------------
//
// ApiFill
......@@ -4491,6 +4547,12 @@
ApiChart.prototype["SetHorAxisMinorTickMark"] = ApiChart.prototype.SetHorAxisMinorTickMark;
ApiChart.prototype["SetVertAxisMajorTickMark"] = ApiChart.prototype.SetVertAxisMajorTickMark;
ApiChart.prototype["SetVertAxisMinorTickMark"] = ApiChart.prototype.SetVertAxisMinorTickMark;
ApiChart.prototype["SetMajorVerticalGridlines"] = ApiChart.prototype.SetMajorVerticalGridlines;
ApiChart.prototype["SetMinorVerticalGridlines"] = ApiChart.prototype.SetMinorVerticalGridlines;
ApiChart.prototype["SetMajorHorizontalGridlines"] = ApiChart.prototype.SetMajorHorizontalGridlines;
ApiChart.prototype["SetMinorHorizontalGridlines"] = ApiChart.prototype.SetMinorHorizontalGridlines;
ApiChart.prototype["SetHorAxisLablesFontSize"] = ApiChart.prototype.SetHorAxisLablesFontSize;
ApiChart.prototype["SetVertAxisLablesFontSize"] = ApiChart.prototype.SetVertAxisLablesFontSize;
ApiFill.prototype["GetClassType"] = ApiFill.prototype.GetClassType;
......
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