Commit 08b86c90 authored by Sergey Luzyanin's avatar Sergey Luzyanin

Methods for set axis tick labels

parent f3710dbf
......@@ -125,6 +125,11 @@
* "yellowGreen")} PresetColor
* */
/**
*
* @typedef {("none" | "nextTo" | "low" | "high")} TickLabelPosition
* **/
/**
* Class representing a base class for color types
* @constructor
......@@ -918,6 +923,22 @@
{
AscFormat.builder_SetShowDataLabels(this.Chart, bShowSerName, bShowCatName, bShowVal, bShowPercent);
};
/**
* Spicifies tick labels position vertical axis
* @param {TickLabelPosition} sTickLabelPosition
* */
ApiChart.prototype.SetVertAxisTickLabelPosition = function(sTickLabelPosition)
{
AscFormat.builder_SetChartVertAxisTickLablePosition(this.Chart, sTickLabelPosition);
};
/**
* Spicifies tick labels position horizontal axis
* @param {TickLabelPosition} sTickLabelPosition
* */
ApiChart.prototype.SetHorAxisTickLabelPosition = function(sTickLabelPosition)
{
AscFormat.builder_SetChartHorAxisTickLablePosition(this.Chart, sTickLabelPosition);
};
Api.prototype["GetActiveSheet"] = Api.prototype.GetActiveSheet;
......@@ -957,24 +978,26 @@
ApiRange.prototype["UnMerge"] = ApiRange.prototype.UnMerge;
ApiDrawing.prototype["GetClassType"] = ApiDrawing.prototype.GetClassType;
ApiDrawing.prototype["SetSize"] = ApiDrawing.prototype.SetSize;
ApiDrawing.prototype["SetPosition"] = ApiDrawing.prototype.SetPosition;
ApiDrawing.prototype["GetClassType"] = ApiDrawing.prototype.GetClassType;
ApiDrawing.prototype["SetSize"] = ApiDrawing.prototype.SetSize;
ApiDrawing.prototype["SetPosition"] = ApiDrawing.prototype.SetPosition;
ApiImage.prototype["GetClassType"] = ApiImage.prototype.GetClassType;
ApiImage.prototype["GetClassType"] = ApiImage.prototype.GetClassType;
ApiShape.prototype["GetClassType"] = ApiShape.prototype.GetClassType;
ApiShape.prototype["GetDocContent"] = ApiShape.prototype.GetDocContent;
ApiShape.prototype["SetVerticalTextAlign"] = ApiShape.prototype.SetVerticalTextAlign;
ApiShape.prototype["GetClassType"] = ApiShape.prototype.GetClassType;
ApiShape.prototype["GetDocContent"] = ApiShape.prototype.GetDocContent;
ApiShape.prototype["SetVerticalTextAlign"] = ApiShape.prototype.SetVerticalTextAlign;
ApiChart.prototype["GetClassType"] = ApiChart.prototype.GetClassType;
ApiChart.prototype["SetTitle"] = ApiChart.prototype.SetTitle;
ApiChart.prototype["SetHorAxisTitle"] = ApiChart.prototype.SetHorAxisTitle;
ApiChart.prototype["SetVerAxisTitle"] = ApiChart.prototype.SetVerAxisTitle;
ApiChart.prototype["SetVerAxisOrientation"] = ApiChart.prototype.SetVerAxisOrientation;
ApiChart.prototype["SetHorAxisOrientation"] = ApiChart.prototype.SetHorAxisOrientation;
ApiChart.prototype["SetLegendPos"] = ApiChart.prototype.SetLegendPos;
ApiChart.prototype["SetShowDataLabels"] = ApiChart.prototype.SetShowDataLabels;
ApiChart.prototype["GetClassType"] = ApiChart.prototype.GetClassType;
ApiChart.prototype["SetTitle"] = ApiChart.prototype.SetTitle;
ApiChart.prototype["SetHorAxisTitle"] = ApiChart.prototype.SetHorAxisTitle;
ApiChart.prototype["SetVerAxisTitle"] = ApiChart.prototype.SetVerAxisTitle;
ApiChart.prototype["SetVerAxisOrientation"] = ApiChart.prototype.SetVerAxisOrientation;
ApiChart.prototype["SetHorAxisOrientation"] = ApiChart.prototype.SetHorAxisOrientation;
ApiChart.prototype["SetLegendPos"] = ApiChart.prototype.SetLegendPos;
ApiChart.prototype["SetShowDataLabels"] = ApiChart.prototype.SetShowDataLabels;
ApiChart.prototype["SetVertAxisTickLabelPosition"] = ApiChart.prototype.SetVertAxisTickLabelPosition;
ApiChart.prototype["SetHorAxisTickLabelPosition"] = ApiChart.prototype.SetHorAxisTickLabelPosition;
function private_SetCoords(oDrawing, oWorksheet, nExtX, nExtY, nFromCol, nColOffset, nFromRow, nRowOffset){
......
......@@ -12559,6 +12559,45 @@ function CorrectUniColor(asc_color, unicolor, flag)
}
function builder_SetChartAxisLabelsPos(oAxis, sPosition){
if(!oAxis || !oAxis.setTickLblPos){
return;
}
var nPositionType = null;
var c_oAscTickLabelsPos = window['Asc'].c_oAscTickLabelsPos;
switch(sPosition){
case "high":{
nPositionType = c_oAscTickLabelsPos.TICK_LABEL_POSITION_HIGH;
break;
}
case "low":{
nPositionType = c_oAscTickLabelsPos.TICK_LABEL_POSITION_LOW;
break;
}
case "nextTo":{
nPositionType = c_oAscTickLabelsPos.TICK_LABEL_POSITION_LOW;
break;
}
case "none":{
nPositionType = c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE;
break;
}
}
if(nPositionType !== null){
oAxis.setTickLblPos(nPositionType);
}
}
function builder_SetChartVertAxisTickLablePosition(oChartSpace, sPosition){
if(oChartSpace){
builder_SetChartAxisLabelsPos(oChartSpace.chart.plotArea.getVerticalAxis(), sPosition);
}
}
function builder_SetChartHorAxisTickLablePosition(oChartSpace, sPosition){
if(oChartSpace){
builder_SetChartAxisLabelsPos(oChartSpace.chart.plotArea.getHorizontalAxis(), sPosition);
}
}
//----------------------------------------------------------export----------------------------------------------------
window['AscFormat'] = window['AscFormat'] || {};
......@@ -12679,6 +12718,8 @@ function CorrectUniColor(asc_color, unicolor, flag)
window['AscFormat'].builder_SetChartVertAxisOrientation = builder_SetChartVertAxisOrientation;
window['AscFormat'].builder_SetChartHorAxisOrientation = builder_SetChartHorAxisOrientation;
window['AscFormat'].builder_SetChartVertAxisTickLablePosition = builder_SetChartVertAxisTickLablePosition;
window['AscFormat'].builder_SetChartHorAxisTickLablePosition = builder_SetChartHorAxisTickLablePosition;
window['AscFormat'].Ax_Counter = Ax_Counter;
window['AscFormat'].TYPE_TRACK = TYPE_TRACK;
......
......@@ -183,6 +183,12 @@
* @typedef {("aliceBlue" | "antiqueWhite" | "aqua" | "aquamarine" | "azure" | "beige" | "bisque" | "black" | "blanchedAlmond" | "blue" | "blueViolet" | "brown" | "burlyWood" | "cadetBlue" | "chartreuse" | "chocolate" | "coral" | "cornflowerBlue" | "cornsilk" | "crimson" | "cyan" | "darkBlue" | "darkCyan" | "darkGoldenrod" | "darkGray" | "darkGreen" | "darkGrey" | "darkKhaki" | "darkMagenta" | "darkOliveGreen" | "darkOrange" | "darkOrchid" | "darkRed" | "darkSalmon" | "darkSeaGreen" | "darkSlateBlue" | "darkSlateGray" | "darkSlateGrey" | "darkTurquoise" | "darkViolet" | "deepPink" | "deepSkyBlue" | "dimGray" | "dimGrey" | "dkBlue" | "dkCyan" | "dkGoldenrod" | "dkGray" | "dkGreen" | "dkGrey" | "dkKhaki" | "dkMagenta" | "dkOliveGreen" | "dkOrange" | "dkOrchid" | "dkRed" | "dkSalmon" | "dkSeaGreen" | "dkSlateBlue" | "dkSlateGray" | "dkSlateGrey" | "dkTurquoise" | "dkViolet" | "dodgerBlue" | "firebrick" | "floralWhite" | "forestGreen" | "fuchsia" | "gainsboro" | "ghostWhite" | "gold" | "goldenrod" | "gray" | "green" | "greenYellow" | "grey" | "honeydew" | "hotPink" | "indianRed" | "indigo" | "ivory" | "khaki" | "lavender" | "lavenderBlush" | "lawnGreen" | "lemonChiffon" | "lightBlue" | "lightCoral" | "lightCyan" | "lightGoldenrodYellow" | "lightGray" | "lightGreen" | "lightGrey" | "lightPink" | "lightSalmon" | "lightSeaGreen" | "lightSkyBlue" | "lightSlateGray" | "lightSlateGrey" | "lightSteelBlue" | "lightYellow" | "lime" | "limeGreen" | "linen" | "ltBlue" | "ltCoral" | "ltCyan" | "ltGoldenrodYellow" | "ltGray" | "ltGreen" | "ltGrey" | "ltPink" | "ltSalmon" | "ltSeaGreen" | "ltSkyBlue" | "ltSlateGray" | "ltSlateGrey" | "ltSteelBlue" | "ltYellow" | "magenta" | "maroon" | "medAquamarine" | "medBlue" | "mediumAquamarine" | "mediumBlue" | "mediumOrchid" | "mediumPurple" | "mediumSeaGreen" | "mediumSlateBlue" | "mediumSpringGreen" | "mediumTurquoise" | "mediumVioletRed" | "medOrchid" | "medPurple" | "medSeaGreen" | "medSlateBlue" | "medSpringGreen" | "medTurquoise" | "medVioletRed" | "midnightBlue" | "mintCream" | "mistyRose" | "moccasin" | "navajoWhite" | "navy" | "oldLace" | "olive" | "oliveDrab" | "orange" | "orangeRed" | "orchid" | "paleGoldenrod" | "paleGreen" | "paleTurquoise" | "paleVioletRed" | "papayaWhip" | "peachPuff" | "peru" | "pink" | "plum" | "powderBlue" | "purple" | "red" | "rosyBrown" | "royalBlue" | "saddleBrown" | "salmon" | "sandyBrown" | "seaGreen" | "seaShell" | "sienna" | "silver" | "skyBlue" | "slateBlue" | "slateGray" | "slateGrey" | "snow" | "springGreen" | "steelBlue" | "tan" | "teal" | "thistle" | "tomato" | "turquoise" | "violet" | "wheat" | "white" | "whiteSmoke" | "yellow" | "yellowGreen")} PresetColor
* */
/**
*
* @typedef {("none" | "nextTo" | "low" | "high")} TickLabelPosition
* **/
/**
* @typedef {"tile" | "stretch"} BlipFillType
* */
......@@ -685,6 +691,23 @@
AscFormat.builder_SetShowDataLabels(this.Chart, bShowSerName, bShowCatName, bShowVal, bShowPercent);
};
/**
* Spicifies tick labels position vertical axis
* @param {TickLabelPosition} sTickLabelPosition
* */
ApiChart.prototype.SetVertAxisTickLabelPosition = function(sTickLabelPosition)
{
AscFormat.builder_SetChartVertAxisTickLablePosition(this.Chart, sTickLabelPosition);
};
/**
* Spicifies tick labels position horizontal axis
* @param {TickLabelPosition} sTickLabelPosition
* */
ApiChart.prototype.SetHorAxisTickLabelPosition = function(sTickLabelPosition)
{
AscFormat.builder_SetChartHorAxisTickLablePosition(this.Chart, sTickLabelPosition);
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Export
......@@ -722,14 +745,16 @@
ApiShape.prototype["GetDocContent"] = ApiShape.prototype.GetDocContent;
ApiShape.prototype["SetVerticalTextAlign"] = ApiShape.prototype.SetVerticalTextAlign;
ApiChart.prototype["GetClassType"] = ApiChart.prototype.GetClassType;
ApiChart.prototype["SetTitle"] = ApiChart.prototype.SetTitle;
ApiChart.prototype["SetHorAxisTitle"] = ApiChart.prototype.SetHorAxisTitle;
ApiChart.prototype["SetVerAxisTitle"] = ApiChart.prototype.SetVerAxisTitle;
ApiChart.prototype["SetVerAxisOrientation"] = ApiChart.prototype.SetVerAxisOrientation;
ApiChart.prototype["SetHorAxisOrientation"] = ApiChart.prototype.SetHorAxisOrientation;
ApiChart.prototype["SetLegendPos"] = ApiChart.prototype.SetLegendPos;
ApiChart.prototype["SetShowDataLabels"] = ApiChart.prototype.SetShowDataLabels;
ApiChart.prototype["GetClassType"] = ApiChart.prototype.GetClassType;
ApiChart.prototype["SetTitle"] = ApiChart.prototype.SetTitle;
ApiChart.prototype["SetHorAxisTitle"] = ApiChart.prototype.SetHorAxisTitle;
ApiChart.prototype["SetVerAxisTitle"] = ApiChart.prototype.SetVerAxisTitle;
ApiChart.prototype["SetVerAxisOrientation"] = ApiChart.prototype.SetVerAxisOrientation;
ApiChart.prototype["SetHorAxisOrientation"] = ApiChart.prototype.SetHorAxisOrientation;
ApiChart.prototype["SetLegendPos"] = ApiChart.prototype.SetLegendPos;
ApiChart.prototype["SetShowDataLabels"] = ApiChart.prototype.SetShowDataLabels;
ApiChart.prototype["SetVertAxisTickLabelPosition"] = ApiChart.prototype.SetVertAxisTickLabelPosition;
ApiChart.prototype["SetHorAxisTickLabelPosition"] = ApiChart.prototype.SetHorAxisTickLabelPosition;
function private_GetCurrentSlide(){
var oApiPresentation = editor.GetPresentation();
......
......@@ -532,6 +532,12 @@
* "greenYellow" | "grey" | "honeydew" | "hotPink" | "indianRed" | "indigo" | "ivory" | "khaki" | "lavender" | "lavenderBlush" | "lawnGreen" | "lemonChiffon" | "lightBlue" | "lightCoral" | "lightCyan" | "lightGoldenrodYellow" | "lightGray" | "lightGreen" | "lightGrey" | "lightPink" | "lightSalmon" | "lightSeaGreen" | "lightSkyBlue" | "lightSlateGray" | "lightSlateGrey" | "lightSteelBlue" | "lightYellow" | "lime" | "limeGreen" | "linen" | "ltBlue" | "ltCoral" | "ltCyan" | "ltGoldenrodYellow" | "ltGray" | "ltGreen" | "ltGrey" | "ltPink" | "ltSalmon" | "ltSeaGreen" | "ltSkyBlue" | "ltSlateGray" | "ltSlateGrey" | "ltSteelBlue" | "ltYellow" | "magenta" | "maroon" | "medAquamarine" | "medBlue" | "mediumAquamarine" | "mediumBlue" | "mediumOrchid" | "mediumPurple" | "mediumSeaGreen" | "mediumSlateBlue" | "mediumSpringGreen" | "mediumTurquoise" | "mediumVioletRed" | "medOrchid" | "medPurple" | "medSeaGreen" | "medSlateBlue" | "medSpringGreen" | "medTurquoise" | "medVioletRed" | "midnightBlue" | "mintCream" | "mistyRose" | "moccasin" | "navajoWhite" | "navy" | "oldLace" | "olive" | "oliveDrab" | "orange" | "orangeRed" | "orchid" | "paleGoldenrod" | "paleGreen" | "paleTurquoise" | "paleVioletRed" | "papayaWhip" | "peachPuff" | "peru" | "pink" | "plum" | "powderBlue" | "purple" | "red" | "rosyBrown" | "royalBlue" | "saddleBrown" | "salmon" | "sandyBrown" | "seaGreen" | "seaShell" | "sienna" | "silver" | "skyBlue" | "slateBlue" | "slateGray" | "slateGrey" | "snow" | "springGreen" | "steelBlue" | "tan" | "teal" | "thistle" | "tomato" | "turquoise" | "violet" | "wheat" | "white" | "whiteSmoke" | "yellow" | "yellowGreen")} PresetColor
* */
/**
*
* @typedef {("none" | "nextTo" | "low" | "high")} TickLabelPosition
* **/
/**
* @typedef {"tile" | "stretch"} BlipFillType
* */
......@@ -4085,6 +4091,25 @@
AscFormat.builder_SetShowDataLabels(this.Chart, bShowSerName, bShowCatName, bShowVal, bShowPercent);
};
/**
* Spicifies tick labels position vertical axis
* @param {TickLabelPosition} sTickLabelPosition
* */
ApiChart.prototype.SetVertAxisTickLabelPosition = function(sTickLabelPosition)
{
AscFormat.builder_SetChartVertAxisTickLablePosition(this.Chart, sTickLabelPosition);
};
/**
* Spicifies tick labels position horizontal axis
* @param {TickLabelPosition} sTickLabelPosition
* */
ApiChart.prototype.SetHorAxisTickLabelPosition = function(sTickLabelPosition)
{
AscFormat.builder_SetChartHorAxisTickLablePosition(this.Chart, sTickLabelPosition);
};
//------------------------------------------------------------------------------------------------------------------
//
// ApiFill
......@@ -4433,14 +4458,16 @@
ApiShape.prototype["SetVerticalTextAlign"] = ApiShape.prototype.SetVerticalTextAlign;
ApiShape.prototype["SetPaddings"] = ApiShape.prototype.SetPaddings;
ApiChart.prototype["GetClassType"] = ApiChart.prototype.GetClassType;
ApiChart.prototype["SetTitle"] = ApiChart.prototype.SetTitle;
ApiChart.prototype["SetHorAxisTitle"] = ApiChart.prototype.SetHorAxisTitle;
ApiChart.prototype["SetVerAxisTitle"] = ApiChart.prototype.SetVerAxisTitle;
ApiChart.prototype["SetVerAxisOrientation"] = ApiChart.prototype.SetVerAxisOrientation;
ApiChart.prototype["SetHorAxisOrientation"] = ApiChart.prototype.SetHorAxisOrientation;
ApiChart.prototype["SetLegendPos"] = ApiChart.prototype.SetLegendPos;
ApiChart.prototype["SetShowDataLabels"] = ApiChart.prototype.SetShowDataLabels;
ApiChart.prototype["GetClassType"] = ApiChart.prototype.GetClassType;
ApiChart.prototype["SetTitle"] = ApiChart.prototype.SetTitle;
ApiChart.prototype["SetHorAxisTitle"] = ApiChart.prototype.SetHorAxisTitle;
ApiChart.prototype["SetVerAxisTitle"] = ApiChart.prototype.SetVerAxisTitle;
ApiChart.prototype["SetVerAxisOrientation"] = ApiChart.prototype.SetVerAxisOrientation;
ApiChart.prototype["SetHorAxisOrientation"] = ApiChart.prototype.SetHorAxisOrientation;
ApiChart.prototype["SetLegendPos"] = ApiChart.prototype.SetLegendPos;
ApiChart.prototype["SetShowDataLabels"] = ApiChart.prototype.SetShowDataLabels;
ApiChart.prototype["SetVertAxisTickLabelPosition"] = ApiChart.prototype.SetVertAxisTickLabelPosition;
ApiChart.prototype["SetHorAxisTickLabelPosition"] = ApiChart.prototype.SetHorAxisTickLabelPosition;
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