Commit c38bcbc4 authored by Sergey Luzyanin's avatar Sergey Luzyanin

added SetVerAxisOrientation and SetHorAxisOrientation to ApiChart

parent 0d536c96
...@@ -841,6 +841,23 @@ ...@@ -841,6 +841,23 @@
AscFormat.builder_SetChartVertAxisTitle(this.Chart, sTitle, nFontSize); AscFormat.builder_SetChartVertAxisTitle(this.Chart, sTitle, nFontSize);
}; };
/**
* Specifies a vertical axis orientation
* @param {bool} bIsMinMax
* */
ApiChart.prototype.SetVerAxisOrientation = function(bIsMinMax){
AscFormat.builder_SetChartVertAxisOrientation(this.Chart, bIsMinMax);
};
/**
* Specifies a horizontal axis orientation
* @param {bool} bIsMinMax
* */
ApiChart.prototype.SetHorAxisOrientation = function(bIsMinMax){
AscFormat.builder_SetChartHorAxisOrientation(this.Chart, bIsMinMax);
};
/** /**
* Specifies a legend position * Specifies a legend position
* @param {"left" | "top" | "right" | "bottom" | "none"} sLegendPos * @param {"left" | "top" | "right" | "bottom" | "none"} sLegendPos
...@@ -911,9 +928,12 @@ ...@@ -911,9 +928,12 @@
ApiChart.prototype["SetTitle"] = ApiChart.prototype.SetTitle; ApiChart.prototype["SetTitle"] = ApiChart.prototype.SetTitle;
ApiChart.prototype["SetHorAxisTitle"] = ApiChart.prototype.SetHorAxisTitle; ApiChart.prototype["SetHorAxisTitle"] = ApiChart.prototype.SetHorAxisTitle;
ApiChart.prototype["SetVerAxisTitle"] = ApiChart.prototype.SetVerAxisTitle; 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["SetLegendPos"] = ApiChart.prototype.SetLegendPos;
ApiChart.prototype["SetShowDataLabels"] = ApiChart.prototype.SetShowDataLabels; ApiChart.prototype["SetShowDataLabels"] = ApiChart.prototype.SetShowDataLabels;
function private_SetCoords(oDrawing, oWorksheet, nExtX, nExtY, nFromCol, nColOffset, nFromRow, nRowOffset){ function private_SetCoords(oDrawing, oWorksheet, nExtX, nExtY, nFromCol, nColOffset, nFromRow, nRowOffset){
oDrawing.x = 0; oDrawing.x = 0;
oDrawing.y = 0; oDrawing.y = 0;
......
...@@ -12439,6 +12439,43 @@ function CorrectUniColor(asc_color, unicolor, flag) ...@@ -12439,6 +12439,43 @@ function CorrectUniColor(asc_color, unicolor, flag)
} }
} }
function builder_SetChartVertAxisOrientation(oChartSpace, bIsMinMax) {
if(oChartSpace){
var verAxis = oChartSpace.chart.plotArea.getVerticalAxis();
if(verAxis)
{
if(!verAxis.scaling)
verAxis.setScaling(new CScaling());
var scaling = verAxis.scaling;
if(bIsMinMax){
scaling.setOrientation(AscFormat.ORIENTATION_MIN_MAX);
}
else{
scaling.setOrientation(AscFormat.ORIENTATION_MAX_MIN);
}
}
}
}
function builder_SetChartHorAxisOrientation(oChartSpace, bIsMinMax){
if(oChartSpace){
var horAxis = oChartSpace.chart.plotArea.getHorizontalAxis();
if(horAxis){
if(!horAxis.scaling)
horAxis.setScaling(new CScaling());
var scaling = horAxis.scaling;
if(bIsMinMax){
scaling.setOrientation(AscFormat.ORIENTATION_MIN_MAX);
}
else{
scaling.setOrientation(AscFormat.ORIENTATION_MAX_MIN);
}
}
}
}
function builder_SetChartLegendPos(oChartSpace, sLegendPos){ function builder_SetChartLegendPos(oChartSpace, sLegendPos){
if(oChartSpace && oChartSpace.chart) if(oChartSpace && oChartSpace.chart)
...@@ -12636,6 +12673,9 @@ function CorrectUniColor(asc_color, unicolor, flag) ...@@ -12636,6 +12673,9 @@ function CorrectUniColor(asc_color, unicolor, flag)
window['AscFormat'].builder_SetChartLegendPos = builder_SetChartLegendPos; window['AscFormat'].builder_SetChartLegendPos = builder_SetChartLegendPos;
window['AscFormat'].builder_SetShowDataLabels = builder_SetShowDataLabels; window['AscFormat'].builder_SetShowDataLabels = builder_SetShowDataLabels;
window['AscFormat'].builder_SetChartVertAxisOrientation = builder_SetChartVertAxisOrientation;
window['AscFormat'].builder_SetChartHorAxisOrientation = builder_SetChartHorAxisOrientation;
window['AscFormat'].Ax_Counter = Ax_Counter; window['AscFormat'].Ax_Counter = Ax_Counter;
window['AscFormat'].TYPE_TRACK = TYPE_TRACK; window['AscFormat'].TYPE_TRACK = TYPE_TRACK;
window['AscFormat'].TYPE_KIND = TYPE_KIND; window['AscFormat'].TYPE_KIND = TYPE_KIND;
......
...@@ -656,6 +656,23 @@ ...@@ -656,6 +656,23 @@
AscFormat.builder_SetChartLegendPos(this.Chart, sLegendPos); AscFormat.builder_SetChartLegendPos(this.Chart, sLegendPos);
}; };
/**
* Specifies a vertical axis orientation
* @param {bool} bIsMinMax
* */
ApiChart.prototype.SetVerAxisOrientation = function(bIsMinMax){
AscFormat.builder_SetChartVertAxisOrientation(this.Chart, bIsMinMax);
};
/**
* Specifies a horizontal axis orientation
* @param {bool} bIsMinMax
* */
ApiChart.prototype.SetHorAxisOrientation = function(bIsMinMax){
AscFormat.builder_SetChartHorAxisOrientation(this.Chart, bIsMinMax);
};
/** /**
* Spicifies a show options for data labels * Spicifies a show options for data labels
* @param {boolean} bShowSerName * @param {boolean} bShowSerName
...@@ -708,6 +725,8 @@ ...@@ -708,6 +725,8 @@
ApiChart.prototype["SetTitle"] = ApiChart.prototype.SetTitle; ApiChart.prototype["SetTitle"] = ApiChart.prototype.SetTitle;
ApiChart.prototype["SetHorAxisTitle"] = ApiChart.prototype.SetHorAxisTitle; ApiChart.prototype["SetHorAxisTitle"] = ApiChart.prototype.SetHorAxisTitle;
ApiChart.prototype["SetVerAxisTitle"] = ApiChart.prototype.SetVerAxisTitle; 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["SetLegendPos"] = ApiChart.prototype.SetLegendPos;
ApiChart.prototype["SetShowDataLabels"] = ApiChart.prototype.SetShowDataLabels; ApiChart.prototype["SetShowDataLabels"] = ApiChart.prototype.SetShowDataLabels;
......
...@@ -3998,6 +3998,23 @@ ...@@ -3998,6 +3998,23 @@
} }
}; };
/**
* Specifies a vertical axis orientation
* @param {bool} bIsMinMax
* */
ApiChart.prototype.SetVerAxisOrientation = function(bIsMinMax){
AscFormat.builder_SetChartVertAxisOrientation(this.Chart, bIsMinMax);
};
/**
* Specifies a horizontal axis orientation
* @param {bool} bIsMinMax
* */
ApiChart.prototype.SetHorAxisOrientation = function(bIsMinMax){
AscFormat.builder_SetChartHorAxisOrientation(this.Chart, bIsMinMax);
};
/** /**
* Specifies a legend position * Specifies a legend position
* @param {"left" | "top" | "right" | "bottom" | "none"} sLegendPos * @param {"left" | "top" | "right" | "bottom" | "none"} sLegendPos
...@@ -4440,6 +4457,8 @@ ...@@ -4440,6 +4457,8 @@
ApiChart.prototype["SetTitle"] = ApiChart.prototype.SetTitle; ApiChart.prototype["SetTitle"] = ApiChart.prototype.SetTitle;
ApiChart.prototype["SetHorAxisTitle"] = ApiChart.prototype.SetHorAxisTitle; ApiChart.prototype["SetHorAxisTitle"] = ApiChart.prototype.SetHorAxisTitle;
ApiChart.prototype["SetVerAxisTitle"] = ApiChart.prototype.SetVerAxisTitle; 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["SetLegendPos"] = ApiChart.prototype.SetLegendPos;
ApiChart.prototype["SetShowDataLabels"] = ApiChart.prototype.SetShowDataLabels; ApiChart.prototype["SetShowDataLabels"] = ApiChart.prototype.SetShowDataLabels;
......
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