Adding button for switch on/off chart elements for [DE, PE]

This commit is contained in:
Dmitry-Ilyushechkin
2025-05-14 13:08:15 +03:00
parent ec6e4c3614
commit 9c6e934900
6 changed files with 1702 additions and 0 deletions

View File

@ -53,6 +53,7 @@ define([], function () {
});
if (this.api) {
this.api.asc_registerCallback('asc_onSingleChartSelectionChanged', _.bind(this.onSingleChartSelectionChanged, this));
this.api.asc_registerCallback('asc_onContextMenu', _.bind(this.onContextMenu, this));
this.api.asc_registerCallback('asc_onMouseMoveStart', _.bind(this.onMouseMoveStart, this));
this.api.asc_registerCallback('asc_onMouseMoveEnd', _.bind(this.onMouseMoveEnd, this));
@ -294,6 +295,12 @@ define([], function () {
view.menuTableListIndents.on('click', _.bind(me.onListIndents, me));
view.menuParaListIndents.on('click', _.bind(me.onListIndents, me));
view.menuSaveAsPicture.on('click', _.bind(me.saveAsPicture, me));
view.menuChartElement.on('item:click', _.bind(me.onChartElement, me));
view.menuChartElement.menu.items.forEach(item => {
if (item.menu) {
item.menu.on('item:click', _.bind(me.onChartElement, me));
}
});
me.onChangeProtectDocument();
};
@ -780,6 +787,506 @@ define([], function () {
}
};
const chartElementMap = {
0: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'trendLines'],
1: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend'],
2: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend'],
3: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'gridLines', 'legend'],
4: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'gridLines', 'legend'],
5: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'gridLines', 'legend'],
6: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'gridLines', 'legend'],
7: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'trendLines', 'upDownBars'],
8: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'upDownBars'],
9: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'trendLines', 'upDownBars'],
10: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'trendLines', 'upDownBars'],
11: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'upDownBars'],
12: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'upDownBars'],
13: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'gridLines', 'legend'],
14: ['chartTitle', 'dataLabels', 'legend'],
15: ['chartTitle', 'dataLabels', 'legend'],
16: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'trendLines'],
17: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend'],
18: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend'],
19: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'gridLines', 'legend'],
20: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'gridLines', 'legend'],
21: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'gridLines', 'legend'],
22: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend'],
23: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend'],
24: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend'],
25: ['chartTitle', 'dataLabels', 'legend'],
26: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'trendLines', 'upDownBars'],
27: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'errorBars', 'gridLines', 'legend', 'trendLines'],
28: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'errorBars', 'gridLines', 'legend', 'trendLines'],
29: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'errorBars', 'gridLines', 'legend', 'trendLines'],
30: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'errorBars', 'gridLines', 'legend', 'trendLines'],
31: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'errorBars', 'gridLines', 'legend', 'trendLines'],
32: ['axes', 'axisTitles', 'chartTitle', 'dataTable', 'errorBars', 'gridLines', 'legend', 'trendLines'],
33: ['axes', 'axisTitles', 'chartTitle', 'dataTable', 'errorBars', 'gridLines', 'legend', 'trendLines'],
34: ['axes', 'axisTitles', 'chartTitle', 'gridLines', 'legend'],
35: ['axes', 'axisTitles', 'chartTitle', 'gridLines', 'legend'],
36: ['axes', 'axisTitles', 'chartTitle', 'gridLines', 'legend'],
37: ['axes', 'axisTitles', 'chartTitle', 'gridLines', 'legend'],
38: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'trendLines'],
39: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'trendLines'],
40: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'trendLines'],
41: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend'],
42: ['axes', 'chartTitle', 'dataLabels', 'gridLines', 'legend'],
43: ['axes', 'chartTitle', 'dataLabels', 'gridLines', 'legend'],
44: ['axes', 'chartTitle', 'dataLabels', 'gridLines', 'legend'],
45: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'trendLines', 'upDownBars']
};
window.highlightedGroups = {};
function highlightSubmenuItem(item, highlight, group) {
if (!item || !item.el || !item.el.classList) return;
if (highlight) {
item.el.classList.add('over');
if (window.highlightedGroups[group] && window.highlightedGroups[group] !== item) {
window.highlightedGroups[group].el.classList.remove('over');
}
window.highlightedGroups[group] = item;
} else {
item.el.classList.remove('over');
if (window.highlightedGroups[group] === item) {
window.highlightedGroups[group] = null;
}
}
}
dh.onChartElement = function(menu, item) {
var chartProps = this.chartProps,
HorAxis = chartProps.getHorAxesProps()?.[0],
SecHorAxis = chartProps.getHorAxesProps()?.[1],
VertAxis = chartProps.getVertAxesProps()?.[0],
SecVertAxis = chartProps.getVertAxesProps()?.[1],
DepthAxis = chartProps.getDepthAxesProps()?.[0],
HorMajorGridlines = HorAxis?.getGridlines() === 1 || HorAxis?.getGridlines() === 3,
HorMinorGridlines = HorAxis?.getGridlines() === 2 || HorAxis?.getGridlines() === 3,
VertMajorGridlines = VertAxis?.getGridlines() === 1 || VertAxis?.getGridlines() === 3,
VertMinorGridlines = VertAxis?.getGridlines() === 2 || VertAxis?.getGridlines() === 3;
const value = item.value,
type = chartProps.getType(),
RadarChart = [42, 43, 44].includes(type),
hBarChart = [16,17,18,19,20,21].includes(type),
scatterChart = [27,28,29,30,31,32,33,34].includes(type);
switch (value) {
case 'bShowHorAxis':
if (hBarChart) {
chartProps.setDisplayAxes(VertAxis?.getShow(), SecVertAxis?.getShow(), item.checked, SecHorAxis?.getShow(), DepthAxis?.getShow());
} else if (scatterChart) {
chartProps.setDisplayAxes(SecVertAxis?.getShow(), SecHorAxis?.getShow(), item.checked, VertAxis?.getShow(), DepthAxis?.getShow());
} else if (type === 38) {
chartProps.setDisplayAxes(item.checked, SecVertAxis?.getShow(), VertAxis?.getShow(), SecHorAxis?.getShow(), DepthAxis?.getShow());
} else {
chartProps.setDisplayAxes(item.checked, SecHorAxis?.getShow(), VertAxis?.getShow(), SecVertAxis?.getShow(), DepthAxis?.getShow());
}
break;
case 'bShowVertAxis':
if (hBarChart) {
chartProps.setDisplayAxes(item.checked, SecVertAxis?.getShow(), HorAxis?.getShow(), SecHorAxis?.getShow(), DepthAxis?.getShow());
} else if (scatterChart) {
chartProps.setDisplayAxes(SecVertAxis?.getShow(), SecHorAxis?.getShow(), HorAxis?.getShow(), item.checked, DepthAxis?.getShow());
} else if (type === 38) {
chartProps.setDisplayAxes(HorAxis?.getShow(), SecVertAxis?.getShow(), item.checked, SecHorAxis?.getShow(), DepthAxis?.getShow());
} else {
chartProps.setDisplayAxes(HorAxis?.getShow(), SecHorAxis?.getShow(), item.checked, SecVertAxis?.getShow(), DepthAxis?.getShow());
}
break;
case 'bShowHorAxSec':
if (type === 38) {
chartProps.setDisplayAxes(HorAxis?.getShow(), SecVertAxis?.getShow(), VertAxis?.getShow(), item.checked, DepthAxis?.getShow());
} else {
chartProps.setDisplayAxes(HorAxis?.getShow(), item.checked, VertAxis?.getShow(), SecVertAxis?.getShow(), DepthAxis?.getShow());
}
break;
case 'bShowVertAxSec':
if (type === 38) {
chartProps.setDisplayAxes(HorAxis?.getShow(), item.checked, VertAxis?.getShow(), SecHorAxis?.getShow(), DepthAxis?.getShow());
} else {
chartProps.setDisplayAxes(HorAxis?.getShow(), SecHorAxis?.getShow(), VertAxis?.getShow(), item.checked, DepthAxis?.getShow());
}
break;
case 'bShowDepthAxes':
chartProps.setDisplayAxes(HorAxis?.getShow(), SecHorAxis?.getShow(), VertAxis?.getShow(), SecVertAxis?.getShow(), item.checked);
break;
case 'bShowHorAxTitle':
if (hBarChart) {
chartProps.setDisplayAxisTitles(VertAxis?.getLabel() === 1, SecVertAxis?.getLabel() === 1, item.checked, SecHorAxis?.getLabel() === 1, DepthAxis?.getLabel() === 1);
} else if (scatterChart) {
chartProps.setDisplayAxisTitles(SecHorAxis?.getLabel() === 1, SecVertAxis?.getLabel() === 1, item.checked, VertAxis?.getLabel() === 1, DepthAxis?.getLabel() === 1);
} else if (type === 38) {
chartProps.setDisplayAxisTitles(item.checked, SecVertAxis?.getLabel() === 1, VertAxis?.getLabel() === 1, SecHorAxis?.getLabel() === 1, DepthAxis?.getLabel() === 1);
} else {
chartProps.setDisplayAxisTitles(item.checked, SecHorAxis?.getLabel() === 1, VertAxis?.getLabel() === 1, SecVertAxis?.getLabel() === 1, DepthAxis?.getLabel() === 1);
}
break;
case 'bShowVertAxTitle':
if (hBarChart) {
chartProps.setDisplayAxisTitles(item.checked, SecVertAxis?.getLabel() === 1, HorAxis?.getLabel() === 1, SecHorAxis?.getLabel() === 1, DepthAxis?.getLabel() === 1);
} else if (scatterChart) {
chartProps.setDisplayAxisTitles(SecHorAxis?.getLabel() === 1, SecVertAxis?.getLabel() === 1, HorAxis?.getLabel() === 1, item.checked, DepthAxis?.getLabel() === 1);
} else if (type === 38) {
chartProps.setDisplayAxisTitles(HorAxis?.getLabel() === 1, SecVertAxis?.getLabel() === 1, item.checked, SecHorAxis?.getLabel() === 1, DepthAxis?.getLabel() === 1);
} else {
chartProps.setDisplayAxisTitles(HorAxis?.getLabel() === 1, SecHorAxis?.getLabel() === 1, item.checked, SecVertAxis?.getLabel() === 1, DepthAxis?.getLabel() === 1);
}
break;
case 'bShowHorAxTitleSec':
if (type === 38) {
chartProps.setDisplayAxisTitles(HorAxis?.getLabel() === 1, SecVertAxis?.getLabel() === 1, VertAxis?.getLabel() === 1, item.checked, DepthAxis?.getLabel() === 1);
} else {
chartProps.setDisplayAxisTitles(HorAxis?.getLabel() === 1, item.checked, VertAxis?.getLabel() === 1, SecVertAxis?.getLabel() === 1, DepthAxis?.getLabel() === 1);
}
break;
case 'bShowVertAxisTitleSec':
if (type === 38) {
chartProps.setDisplayAxisTitles(HorAxis?.getLabel() === 1, item.checked, VertAxis?.getLabel() === 1, SecHorAxis?.getLabel() === 1, DepthAxis?.getLabel() === 1);
} else {
chartProps.setDisplayAxisTitles(HorAxis?.getLabel() === 1, SecHorAxis?.getLabel() === 1, VertAxis?.getLabel() === 1, item.checked, DepthAxis?.getLabel() === 1);
}
case 'bShowDepthAxisTitle':
chartProps.setDisplayAxes(HorAxis?.getLabel() === 1, SecHorAxis?.getLabel() === 1, VertAxis?.getLabel() === 1, SecVertAxis?.getLabel() === 1, item.checked);
break;
case 'bShowChartTitleNone':
chartProps.setDisplayChartTitle(false, false);
break;
case 'bShowChartTitle':
chartProps.setDisplayChartTitle(true, false);
break;
case 'bOverlayTitle':
chartProps.setDisplayChartTitle(true, true);
break;
case 'CenterData':
chartProps.setDisplayDataLabels(true, Asc.c_oAscChartDataLabelsPos.ctr);
break;
case 'InnerBottomData':
chartProps.setDisplayDataLabels(true, Asc.c_oAscChartDataLabelsPos.inBase);
break;
case 'InnerTopData':
chartProps.setDisplayDataLabels(true, Asc.c_oAscChartDataLabelsPos.inEnd);
break;
case 'OuterTopData':
chartProps.setDisplayDataLabels(true, Asc.c_oAscChartDataLabelsPos.outEnd);
break;
case 'TopData':
chartProps.setDisplayDataLabels(true, Asc.c_oAscChartDataLabelsPos.t);
break;
case 'LeftData':
chartProps.setDisplayDataLabels(true, Asc.c_oAscChartDataLabelsPos.l);
break;
case 'RightData':
chartProps.setDisplayDataLabels(true, Asc.c_oAscChartDataLabelsPos.r);
break;
case 'BottomData':
chartProps.setDisplayDataLabels(true, Asc.c_oAscChartDataLabelsPos.b);
break;
case 'FitWidthData':
chartProps.setDisplayDataLabels(true, Asc.c_oAscChartDataLabelsPos.bestFit);
break;
case 'bShowDataLabels':
chartProps.setDisplayDataLabels(false, false);
break;
// case 'bShowDataNone':
// chartProps.setDisplayDataTable(false, false);
// break;
// case 'bShowDataTable':
// chartProps.setDisplayDataTable(true, false);
// break;
// case 'bShowLegendKeys':
// chartProps.setDisplayDataTable(true, true);
// break;
case 'standardError':
chartProps.setDisplayErrorBars(true, 4);
break;
case 'percentage':
chartProps.setDisplayErrorBars(true, 2);
break;
case 'standardDeviation':
chartProps.setDisplayErrorBars(true, 3);
break;
case 'bShowHorMajor':
if (hBarChart) {
chartProps.setDisplayGridlines(HorMajorGridlines, item.checked, HorMinorGridlines, VertMinorGridlines);
} else
chartProps.setDisplayGridlines(item.checked, HorMajorGridlines, VertMinorGridlines, HorMinorGridlines);
break;
case 'bShowVerMajor':
if (hBarChart || RadarChart) {
chartProps.setDisplayGridlines(item.checked, VertMajorGridlines, HorMinorGridlines, VertMinorGridlines);
} else
chartProps.setDisplayGridlines(VertMajorGridlines, item.checked, VertMinorGridlines, HorMinorGridlines);
break;
case 'bShowHorMinor':
if (hBarChart) {
chartProps.setDisplayGridlines(HorMajorGridlines, VertMajorGridlines, HorMinorGridlines, item.checked);
} else
chartProps.setDisplayGridlines(VertMajorGridlines, HorMajorGridlines, item.checked, HorMinorGridlines);
break;
case 'bShowVerMinor':
if (hBarChart || RadarChart) {
chartProps.setDisplayGridlines(HorMajorGridlines, VertMajorGridlines, item.checked, VertMinorGridlines);
}else
chartProps.setDisplayGridlines(VertMajorGridlines, HorMajorGridlines, VertMinorGridlines, item.checked);
break;
case 'LeftLegend':
if (chartProps.getLegendPos() === 1) {
chartProps.setDisplayLegend(false, 0);
} else {
chartProps.setDisplayLegend(true, 1);
}
break;
case 'TopLegend':
if (chartProps.getLegendPos() === 2) {
chartProps.setDisplayLegend(false, 0);
} else {
chartProps.setDisplayLegend(true, 2);
}
break;
case 'RightLegend':
if (chartProps.getLegendPos() === 3) {
chartProps.setDisplayLegend(false, 0);
} else {
chartProps.setDisplayLegend(true, 3);
}
break;
case 'BottomLegend':
if (chartProps.getLegendPos() === 4) {
chartProps.setDisplayLegend(false, 0);
} else {
chartProps.setDisplayLegend(true, 4);
}
break;
case 'trendLineNone':
chartProps.setDisplayTrendlines(false, false, 0, 0);
break;
case 'trendLineLinear':
chartProps.setDisplayTrendlines(true, 1, 0, 0);
break;
case 'trendLineExponential':
chartProps.setDisplayTrendlines(true, 0, 0, 0);
break;
case 'trendLineForecast':
chartProps.setDisplayTrendlines(true, 1, 2, 0);
break;
case 'trendLineMovingAverage':
chartProps.setDisplayTrendlines(true, 3, 0, 0);
break;
case 'bShowUpDownBars':
chartProps.setDisplayUpDownBars(true);
break;
case 'bShowUpDownNone':
chartProps.setDisplayUpDownBars(false);
break;
}
};
dh.updateChartElementMenu = function(menu, chartProps) {
const type = chartProps.getType(),
ComboChart = [38, 39, 40, 41].includes(type),
RadarChart = [42, 43, 44].includes(type);
let LabelGroup1 = [0, 1, 2, 16, 17, 18].includes(type),
LabelGroup2 = [0, 1, 2, 14, 15, 16, 17, 18].includes(type),
LabelGroup3 = [0, 14, 15, 16].includes(type),
LabelGroup4 = [7, 8, 9, 10, 11, 12, 26, 27, 28, 29, 32, 33].includes(type),
LabelGroup5 = [14, 15].includes(type);
if (ComboChart) {
const comboType = chartProps.getSeries()?.[0]?.asc_getChartType(),
isInGroup1 = [0, 1, 2, 16, 17, 18].includes(comboType),
isInGroup2 = [0, 1, 2, 14, 15, 16, 17, 18].includes(comboType),
isInGroup3 = [0, 14, 15, 16].includes(comboType),
isInGroup4 = [7, 8, 9, 10, 11, 12, 26, 27, 28, 29, 32, 33].includes(comboType),
isInGroup5 = [14, 15].includes(comboType);
LabelGroup1 = isInGroup1;
LabelGroup2 = isInGroup2;
LabelGroup3 = isInGroup3;
LabelGroup4 = isInGroup4;
LabelGroup5 = isInGroup5;
}
const axesMenu = menu.items[0].menu;
axesMenu.items[0].setVisible(!RadarChart);
axesMenu.items[0].setChecked(!RadarChart && chartProps.getHorAxesProps()?.[0]?.getShow());
axesMenu.items[1].setChecked(chartProps.getVertAxesProps()?.[0]?.getShow());
axesMenu.items[4].setVisible(chartProps.getDepthAxesProps()?.[0]);
axesMenu.items[4].setChecked(chartProps.getDepthAxesProps()?.[0]?.getShow());
if (ComboChart) {
axesMenu.items[2].setVisible(chartProps.getHorAxesProps()?.[1]);
axesMenu.items[2].setChecked(chartProps.getHorAxesProps()?.[1]?.getShow());
axesMenu.items[3].setVisible(chartProps.getVertAxesProps()?.[1]);
axesMenu.items[3].setChecked(chartProps.getVertAxesProps()?.[1]?.getShow());
} else {
axesMenu.items[2].setVisible(false);
axesMenu.items[3].setVisible(false);
}
const titlesMenu = menu.items[1].menu;
titlesMenu.items[0].setChecked(chartProps.getHorAxesProps()?.[0]?.getLabel() === 1);
titlesMenu.items[1].setChecked(chartProps.getVertAxesProps()?.[0]?.getLabel() === 1);
titlesMenu.items[4].setVisible(chartProps.getDepthAxesProps()?.[0]);
titlesMenu.items[4].setChecked(chartProps.getDepthAxesProps()?.[0]?.getLabel() === 1);
if (ComboChart) {
titlesMenu.items[2].setVisible(chartProps.getHorAxesProps()?.[1]);
titlesMenu.items[2].setChecked(chartProps.getHorAxesProps()?.[1]?.getLabel() === 1);
titlesMenu.items[3].setVisible(chartProps.getVertAxesProps()?.[1]);
titlesMenu.items[3].setChecked(chartProps.getVertAxesProps()?.[1]?.getLabel() === 1);
} else {
titlesMenu.items[2].setVisible(false);
titlesMenu.items[3].setVisible(false);
}
const titleMenu = menu.items[2].menu;
highlightSubmenuItem(titleMenu.items[0], chartProps.getTitle() === 0, 'chartTitle');
highlightSubmenuItem(titleMenu.items[1], chartProps.getTitle() === 2, 'chartTitle');
highlightSubmenuItem(titleMenu.items[2], chartProps.getTitle() === 1, 'chartTitle');
const labelsMenu = menu.items[3].menu;
highlightSubmenuItem(labelsMenu.items[0], chartProps.getDataLabelsPos() === Asc.c_oAscChartDataLabelsPos.none, 'labels');
highlightSubmenuItem(labelsMenu.items[1], chartProps.getDataLabelsPos() === Asc.c_oAscChartDataLabelsPos.ctr, 'labels');
highlightSubmenuItem(labelsMenu.items[2], LabelGroup1 && chartProps.getDataLabelsPos() === Asc.c_oAscChartDataLabelsPos.inBase, 'labels');
highlightSubmenuItem(labelsMenu.items[3], LabelGroup2 && chartProps.getDataLabelsPos() === Asc.c_oAscChartDataLabelsPos.inEnd, 'labels');
highlightSubmenuItem(labelsMenu.items[4], LabelGroup3 && chartProps.getDataLabelsPos() === Asc.c_oAscChartDataLabelsPos.outEnd, 'labels');
highlightSubmenuItem(labelsMenu.items[5], LabelGroup4 && chartProps.getDataLabelsPos() === Asc.c_oAscChartDataLabelsPos.t, 'labels');
highlightSubmenuItem(labelsMenu.items[6], LabelGroup4 && chartProps.getDataLabelsPos() === Asc.c_oAscChartDataLabelsPos.l, 'labels');
highlightSubmenuItem(labelsMenu.items[7], LabelGroup4 && chartProps.getDataLabelsPos() === Asc.c_oAscChartDataLabelsPos.r, 'labels');
highlightSubmenuItem(labelsMenu.items[8], LabelGroup4 && chartProps.getDataLabelsPos() === Asc.c_oAscChartDataLabelsPos.b, 'labels');
highlightSubmenuItem(labelsMenu.items[9], LabelGroup5 && chartProps.getDataLabelsPos() === Asc.c_oAscChartDataLabelsPos.bestFit, 'labels');
if (chartProps.getDataLabelsPos() !== undefined) {
labelsMenu.items[2].setVisible(LabelGroup1);
labelsMenu.items[3].setVisible(LabelGroup2);
labelsMenu.items[4].setVisible(LabelGroup3);
labelsMenu.items[5].setVisible(LabelGroup4);
labelsMenu.items[6].setVisible(LabelGroup4);
labelsMenu.items[7].setVisible(LabelGroup4);
labelsMenu.items[8].setVisible(LabelGroup4);
labelsMenu.items[9].setVisible(LabelGroup5);
}
// const tableMenu = menu.items[4].menu;
// highlightSubmenuItem(tableMenu.items[0], false, 'table');
// highlightSubmenuItem(tableMenu.items[1], false, 'table');
// highlightSubmenuItem(tableMenu.items[2], false,'table');
const gridMenu = menu.items[5].menu;
gridMenu.items[0].setVisible(true);
gridMenu.items[2].setVisible(true);
if (RadarChart) {
gridMenu.items[0].setVisible(false);
gridMenu.items[0].setChecked(false);
gridMenu.items[1].setChecked(chartProps.getVertAxesProps()?.[0]?.getGridlines() === 1 || chartProps.getVertAxesProps()?.[0]?.getGridlines() === 3);
gridMenu.items[2].setChecked(false);
gridMenu.items[2].setVisible(false);
gridMenu.items[3].setChecked(chartProps.getVertAxesProps()?.[0]?.getGridlines() === 2 || chartProps.getVertAxesProps()?.[0]?.getGridlines() === 3);
} else if (type !== 14 && type !== 15) {
gridMenu.items[0].setChecked(chartProps.getVertAxesProps()?.[0]?.getGridlines() === 1 || chartProps.getVertAxesProps()?.[0]?.getGridlines() === 3);
gridMenu.items[1].setChecked(chartProps.getHorAxesProps()?.[0]?.getGridlines() === 1 || chartProps.getHorAxesProps()?.[0]?.getGridlines() === 3);
gridMenu.items[2].setChecked(chartProps.getVertAxesProps()?.[0]?.getGridlines() === 2 || chartProps.getVertAxesProps()?.[0]?.getGridlines() === 3);
gridMenu.items[3].setChecked(chartProps.getHorAxesProps()?.[0]?.getGridlines() === 2 || chartProps.getHorAxesProps()?.[0]?.getGridlines() === 3);
}
const legendMenu = menu.items[6].menu;
highlightSubmenuItem(legendMenu.items[0],chartProps.getLegendPos() === 2, 'legend');
highlightSubmenuItem(legendMenu.items[1],chartProps.getLegendPos() === 1, 'legend');
highlightSubmenuItem(legendMenu.items[2],chartProps.getLegendPos() === 3, 'legend');
highlightSubmenuItem(legendMenu.items[3],chartProps.getLegendPos() === 4, 'legend');
const supportedElements = chartElementMap[type] || chartElementMap[45] || [];
menu.items.forEach(function(item) {
item.setDisabled(supportedElements.indexOf(item.value) === -1);
});
};
dh.onSingleChartSelectionChanged = function(asc_CRect) {
var me = this,
documentHolderView = me.documentHolder,
chartContainer = documentHolderView.cmpEl.find('#chart-element-container');
me.getCurrentChartProps = function() {
var selectedObjects = me.api.asc_getGraphicObjectProps();
for (var i = 0; i < selectedObjects.length; i++) {
if (selectedObjects[i].asc_getObjectType() == Asc.c_oAscTypeSelectElement.Image) {
var elValue = selectedObjects[i].asc_getObjectValue();
if (elValue.asc_getChartProperties()) {
return elValue.asc_getChartProperties();
}
}
}
return null;
};
me.chartProps = me.getCurrentChartProps();
if (chartContainer.length < 1) {
chartContainer = $('<div id="chart-element-container" style="position: absolute; z-index: 1000;"><div id="id-document-holder-btn-chart-element"></div></div>');
documentHolderView.cmpEl.find('#ws-canvas-outer').append(chartContainer);
}
this.isRtlSheet = this.api ? !!this.api.asc_getSheetViewSettings().asc_getRightToLeft() : false;
if (me.chartProps) {
var x = asc_CRect.asc_getX(),
y = asc_CRect.asc_getY(),
width = asc_CRect.asc_getWidth(),
sheetWidth = me.tooltips.coauth.bodyWidth - me.tooltips.coauth.XY[0] - me.tooltips.coauth.rightMenuWidth - 15,
sheetHeight = me.tooltips.coauth.apiHeight - 15,
btnLeft = this.isRtlSheet ? x - 95 : x + width + 10,
btnTop = y;
if (btnLeft + 50 > sheetWidth) {
btnLeft = x - 40;
}
if (btnLeft < 25) {
if (this.isRtlSheet){
btnLeft = x + width - 40;
} else {
chartContainer.hide();
return;
}
}
if (btnTop + 30 > sheetHeight) {
chartContainer.hide();
return;
}
if (btnTop < 20) {
btnTop = 20;
}
chartContainer.css({
left: btnLeft + 'px',
top: btnTop + 'px'
}).show();
if (!me.btnChartElement) {
me.btnChartElement = new Common.UI.Button({
parentEl: $('#id-document-holder-btn-chart-element'),
cls: 'btn-toolbar',
iconCls: 'toolbar__icon btn-chart-elements',
menu: this.documentHolder.menuChartElement.menu
});
me.btnChartElement.on('click', function() {
me.chartProps = me.getCurrentChartProps();
if (me.chartProps) {
me.updateChartElementMenu(me.documentHolder.menuChartElement.menu, me.chartProps);
}
});
}
} else {
chartContainer.hide();
}
};
dh.onShowSpecialPasteOptions = function(specialPasteShowOptions) {
if (this.mode && !this.mode.isEdit) return;

View File

@ -144,6 +144,313 @@ define([], function () {
})
});
me.menuChartElement = new Common.UI.MenuItem({
menu: new Common.UI.Menu({
cls: 'shifted-right',
menuAlign: 'tl-tr',
items: [
{
caption: me.textAxes,
value: 'axes',
disabled: false,
menu: new Common.UI.Menu({
cls: 'shifted-right',
menuAlign: 'tl-tr',
items: [
{
caption: me.textHorAxis,
value: 'bShowHorAxis',
checkable: true
},
{
caption: me.textVertAxis,
value: 'bShowVertAxis',
checkable: true
},
{
caption: me.textHorAxisSec,
value: 'bShowHorAxSec',
checkable: true
},
{
caption: me.textVertAxisSec,
value: 'bShowVertAxSec',
checkable: true
},
{
caption: me.DepthAxis,
value: 'bShowDepthAxes',
checkable: true
}
]
})
},
{
caption: me.textAxisTitles,
value: 'axisTitles',
disabled: false,
menu: new Common.UI.Menu({
cls: 'shifted-right',
menuAlign: 'tl-tr',
items: [
{
caption: me.textHorAxis,
value: 'bShowHorAxTitle',
checkable: true
},
{
caption: me.textVertAxis,
value: 'bShowVertAxTitle',
checkable: true
},
{
caption: me.textHorAxisSec,
value: 'bShowHorAxTitleSec',
checkable: true
},
{
caption: me.textVertAxisSec,
value: 'bShowVertAxisTitleSec',
checkable: true
}
]
})
},
{
caption: me.textChartTitle,
value: 'chartTitle',
disabled: false,
menu: new Common.UI.Menu({
cls: 'shifted-right',
menuAlign: 'tl-tr',
items: [
{
caption: me.textNone,
value: 'bShowChartTitleNone',
disabled: false
},
{
caption: me.textNoOverlay,
value: 'bShowChartTitle',
},
{
caption: me.textOverlay,
value: 'bOverlayTitle'
}
]
})
},
{
caption: me.textDataLabels,
value: 'dataLabels',
disabled: false,
menu: new Common.UI.Menu({
cls: 'shifted-right',
menuAlign: 'tl-tr',
items: [
{
caption: me.textNone,
value: 'bShowDataLabels'
},
{
caption: me.textCenter,
value: 'CenterData'
},
{
caption: me.textInnerBottom,
value: 'InnerBottomData'
},
{
caption: me.textInnerTop,
value: 'InnerTopData'
},
{
caption: me.textOuterTop,
value: 'OuterTopData'
},
{
caption: me.textTop,
value: 'TopData'
},
{
caption: me.textLeftData,
value: 'LeftData'
},
{
caption: me.textRight,
value: 'RightData'
},
{
caption: me.textBottom,
value: 'BottomData'
},
{
caption: me.textFit,
value: 'FitWidthData'
}
]
})
},
// {
// caption: me.textDataTable,
// value: 'dataTable',
// disabled: false,
// menu: new Common.UI.Menu({
// cls: 'shifted-right',
// menuAlign: 'tl-tr',
// items: [
// {
// caption: me.textNone,
// value: 'bShowDataNone'
// },
// {
// caption: me.textShowDataTable,
// value: 'bShowDataTable'
// },
// {
// caption: me.textShowLegendKeys,
// value: 'bShowLegendKeys'
// }
// ]
// })
// },
{
caption: me.textErrorBars,
value: 'errorBars',
disabled: false,
menu: new Common.UI.Menu({
cls: 'shifted-right',
menuAlign: 'tl-tr',
items: [
{
caption: me.textStandardError,
value: 'standardError',
disabled: false
},
{
caption: me.txtPercentage,
value: 'percentage',
disabled: false
},
{
caption: me.textStandardDeviation,
value: 'standardDeviation',
disabled: false
}
]
})
},
{
caption: me.textGridLines,
value: 'gridLines',
disabled: false,
menu: new Common.UI.Menu({
cls: 'shifted-right',
menuAlign: 'tl-tr',
items: [
{
caption: me.textHorizontalMajor,
value: 'bShowHorMajor',
checkable: true
},
{
caption: me.textVerticalMajor,
value: 'bShowVerMajor',
checkable: true
},
{
caption: me.textHorizontalMinor,
value: 'bShowHorMinor',
checkable: true
},
{
caption: me.textVerticalMinor,
value: 'bShowVerMinor',
checkable: true
}
]
})
},
{
caption: me.textLegendPos,
value: 'legend',
disabled: false,
menu: new Common.UI.Menu({
cls: 'shifted-right',
menuAlign: 'tl-tr',
items: [
{
caption: me.textTop,
value: 'TopLegend'
},
{
caption: me.textLeft,
value: 'LeftLegend'
},
{
caption: me.textRight,
value: 'RightLegend'
},
{
caption: me.textBottom,
value: 'BottomLegend'
}
]
})
},
{
caption: me.textTrendline,
value: 'trendLines',
disabled: false,
menu: new Common.UI.Menu({
cls: 'shifted-right',
menuAlign: 'tl-tr',
items: [
{
caption: me.textNone,
value: 'trendLineNone'
},
{
caption: me.textLinear,
value: 'trendLineLinear'
},
{
caption: me.textExponential,
value: 'trendLineExponential'
},
{
caption: me.textLinearForecast,
value: 'trendLineForecast'
},
{
caption: me.textMovingAverage,
value: 'trendLineMovingAverage'
}
]
})
},
{
caption: me.textUpDownBars,
value: 'upDownBars',
disabled: false,
menu: new Common.UI.Menu({
cls: 'shifted-right',
menuAlign: 'tl-tr',
items: [
{
caption: me.textNone,
value: 'bShowUpDownNone'
},
{
caption: me.textShowUpDown,
value: 'bShowUpDownBars'
}
]
})
}
]
})
});
me.mnuGroup = new Common.UI.MenuItem({

View File

@ -2124,6 +2124,46 @@
"DE.Views.DocumentHolder.unicodeText": "Unicode",
"DE.Views.DocumentHolder.updateStyleText": "Update %1 style",
"DE.Views.DocumentHolder.vertAlignText": "Vertical alignment",
"DE.Views.DocumentHolder.textAxes": "Axes",
"DE.Views.DocumentHolder.DepthAxis": "Z axis",
"DE.Views.DocumentHolder.textAxisTitles": "Axis Titles",
"DE.Views.DocumentHolder.textChartTitle": "Chart Title",
"DE.Views.DocumentHolder.textDataTable": "Data Table",
"DE.Views.DocumentHolder.textErrorBars": "Error Bars",
"DE.Views.DocumentHolder.textLines": "Lines",
"DE.Views.DocumentHolder.textTrendline": "Trendline",
"DE.Views.DocumentHolder.textUpDownBars": " Up/Down Bars",
"DE.Views.DocumentHolder.textShowLegendKeys": "Show Legend Keys",
"DE.Views.DocumentHolder.textShowDataTable": "Show Data Table",
"DE.Views.DocumentHolder.textStandardError": "Standard Error",
"DE.Views.DocumentHolder.textStandardDeviation": "Standard Deviation",
"DE.Views.DocumentHolder.textHorizontalMajor": "Horizontal Major",
"DE.Views.DocumentHolder.textVerticalMajor": "Vertical Major",
"DE.Views.DocumentHolder.textHorizontalMinor": "Horizontal Minor",
"DE.Views.DocumentHolder.textVerticalMinor": "Vertical Minor",
"DE.Views.DocumentHolder.textLinear": "Linear",
"DE.Views.DocumentHolder.textExponential": "Exponential",
"DE.Views.DocumentHolder.textLinearForecast": "Linear Forecast",
"DE.Views.DocumentHolder.textMovingAverage": "Moving Average (2)",
"DE.Views.DocumentHolder.textShowUpDown": "Show Up/Down Bars",
"DE.Views.DocumentHolder.textHorAxis": "Horizontal axis",
"DE.Views.DocumentHolder.textHorAxisSec": "Secondary horizontal axis",
"DE.Views.DocumentHolder.textVertAxis": "Vertical axis",
"DE.Views.DocumentHolder.textVertAxisSec": "Secondary vertical axis",
"DE.Views.DocumentHolder.textNoOverlay": "No overlay",
"DE.Views.DocumentHolder.textOverlay": "Overlay",
"DE.Views.DocumentHolder.textDataLabels": "Data labels",
"DE.Views.DocumentHolder.textCenter": "Center",
"DE.Views.DocumentHolder.textInnerBottom": "Inner bottom",
"DE.Views.DocumentHolder.textInnerTop": "Inner top",
"DE.Views.DocumentHolder.textOuterTop": "Outer top",
"DE.Views.DocumentHolder.textTop": "Top",
"DE.Views.DocumentHolder.textLeftData": "Left",
"DE.Views.DocumentHolder.textRight": "Right",
"DE.Views.DocumentHolder.textBottom": "Bottom",
"DE.Views.DocumentHolder.textFit": "Fit to width",
"DE.Views.DocumentHolder.textGridLines": "Gridlines",
"DE.Views.DocumentHolder.textLegendPos": "Legend",
"DE.Views.DropcapSettingsAdvanced.strBorders": "Borders & Fill",
"DE.Views.DropcapSettingsAdvanced.strDropcap": "Drop cap",
"DE.Views.DropcapSettingsAdvanced.strMargins": "Margins",

View File

@ -740,6 +740,506 @@ define([], function () {
me._isFromSlideMenu = number;
};
const chartElementMap = {
0: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'trendLines'],
1: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend'],
2: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend'],
3: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'gridLines', 'legend'],
4: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'gridLines', 'legend'],
5: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'gridLines', 'legend'],
6: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'gridLines', 'legend'],
7: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'trendLines', 'upDownBars'],
8: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'upDownBars'],
9: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'trendLines', 'upDownBars'],
10: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'trendLines', 'upDownBars'],
11: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'upDownBars'],
12: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'upDownBars'],
13: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'gridLines', 'legend'],
14: ['chartTitle', 'dataLabels', 'legend'],
15: ['chartTitle', 'dataLabels', 'legend'],
16: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'trendLines'],
17: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend'],
18: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend'],
19: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'gridLines', 'legend'],
20: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'gridLines', 'legend'],
21: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'gridLines', 'legend'],
22: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend'],
23: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend'],
24: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend'],
25: ['chartTitle', 'dataLabels', 'legend'],
26: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'trendLines', 'upDownBars'],
27: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'errorBars', 'gridLines', 'legend', 'trendLines'],
28: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'errorBars', 'gridLines', 'legend', 'trendLines'],
29: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'errorBars', 'gridLines', 'legend', 'trendLines'],
30: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'errorBars', 'gridLines', 'legend', 'trendLines'],
31: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'errorBars', 'gridLines', 'legend', 'trendLines'],
32: ['axes', 'axisTitles', 'chartTitle', 'dataTable', 'errorBars', 'gridLines', 'legend', 'trendLines'],
33: ['axes', 'axisTitles', 'chartTitle', 'dataTable', 'errorBars', 'gridLines', 'legend', 'trendLines'],
34: ['axes', 'axisTitles', 'chartTitle', 'gridLines', 'legend'],
35: ['axes', 'axisTitles', 'chartTitle', 'gridLines', 'legend'],
36: ['axes', 'axisTitles', 'chartTitle', 'gridLines', 'legend'],
37: ['axes', 'axisTitles', 'chartTitle', 'gridLines', 'legend'],
38: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'trendLines'],
39: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'trendLines'],
40: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'trendLines'],
41: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend'],
42: ['axes', 'chartTitle', 'dataLabels', 'gridLines', 'legend'],
43: ['axes', 'chartTitle', 'dataLabels', 'gridLines', 'legend'],
44: ['axes', 'chartTitle', 'dataLabels', 'gridLines', 'legend'],
45: ['axes', 'axisTitles', 'chartTitle', 'dataLabels', 'dataTable', 'errorBars', 'gridLines', 'legend', 'trendLines', 'upDownBars']
};
window.highlightedGroups = {};
function highlightSubmenuItem(item, highlight, group) {
if (!item || !item.el || !item.el.classList) return;
if (highlight) {
item.el.classList.add('over');
if (window.highlightedGroups[group] && window.highlightedGroups[group] !== item) {
window.highlightedGroups[group].el.classList.remove('over');
}
window.highlightedGroups[group] = item;
} else {
item.el.classList.remove('over');
if (window.highlightedGroups[group] === item) {
window.highlightedGroups[group] = null;
}
}
}
dh.onChartElement = function(menu, item) {
var chartProps = this.chartProps,
HorAxis = chartProps.getHorAxesProps()?.[0],
SecHorAxis = chartProps.getHorAxesProps()?.[1],
VertAxis = chartProps.getVertAxesProps()?.[0],
SecVertAxis = chartProps.getVertAxesProps()?.[1],
DepthAxis = chartProps.getDepthAxesProps()?.[0],
HorMajorGridlines = HorAxis?.getGridlines() === 1 || HorAxis?.getGridlines() === 3,
HorMinorGridlines = HorAxis?.getGridlines() === 2 || HorAxis?.getGridlines() === 3,
VertMajorGridlines = VertAxis?.getGridlines() === 1 || VertAxis?.getGridlines() === 3,
VertMinorGridlines = VertAxis?.getGridlines() === 2 || VertAxis?.getGridlines() === 3;
const value = item.value,
type = chartProps.getType(),
RadarChart = [42, 43, 44].includes(type),
hBarChart = [16,17,18,19,20,21].includes(type),
scatterChart = [27,28,29,30,31,32,33,34].includes(type);
switch (value) {
case 'bShowHorAxis':
if (hBarChart) {
chartProps.setDisplayAxes(VertAxis?.getShow(), SecVertAxis?.getShow(), item.checked, SecHorAxis?.getShow(), DepthAxis?.getShow());
} else if (scatterChart) {
chartProps.setDisplayAxes(SecVertAxis?.getShow(), SecHorAxis?.getShow(), item.checked, VertAxis?.getShow(), DepthAxis?.getShow());
} else if (type === 38) {
chartProps.setDisplayAxes(item.checked, SecVertAxis?.getShow(), VertAxis?.getShow(), SecHorAxis?.getShow(), DepthAxis?.getShow());
} else {
chartProps.setDisplayAxes(item.checked, SecHorAxis?.getShow(), VertAxis?.getShow(), SecVertAxis?.getShow(), DepthAxis?.getShow());
}
break;
case 'bShowVertAxis':
if (hBarChart) {
chartProps.setDisplayAxes(item.checked, SecVertAxis?.getShow(), HorAxis?.getShow(), SecHorAxis?.getShow(), DepthAxis?.getShow());
} else if (scatterChart) {
chartProps.setDisplayAxes(SecVertAxis?.getShow(), SecHorAxis?.getShow(), HorAxis?.getShow(), item.checked, DepthAxis?.getShow());
} else if (type === 38) {
chartProps.setDisplayAxes(HorAxis?.getShow(), SecVertAxis?.getShow(), item.checked, SecHorAxis?.getShow(), DepthAxis?.getShow());
} else {
chartProps.setDisplayAxes(HorAxis?.getShow(), SecHorAxis?.getShow(), item.checked, SecVertAxis?.getShow(), DepthAxis?.getShow());
}
break;
case 'bShowHorAxSec':
if (type === 38) {
chartProps.setDisplayAxes(HorAxis?.getShow(), SecVertAxis?.getShow(), VertAxis?.getShow(), item.checked, DepthAxis?.getShow());
} else {
chartProps.setDisplayAxes(HorAxis?.getShow(), item.checked, VertAxis?.getShow(), SecVertAxis?.getShow(), DepthAxis?.getShow());
}
break;
case 'bShowVertAxSec':
if (type === 38) {
chartProps.setDisplayAxes(HorAxis?.getShow(), item.checked, VertAxis?.getShow(), SecHorAxis?.getShow(), DepthAxis?.getShow());
} else {
chartProps.setDisplayAxes(HorAxis?.getShow(), SecHorAxis?.getShow(), VertAxis?.getShow(), item.checked, DepthAxis?.getShow());
}
break;
case 'bShowDepthAxes':
chartProps.setDisplayAxes(HorAxis?.getShow(), SecHorAxis?.getShow(), VertAxis?.getShow(), SecVertAxis?.getShow(), item.checked);
break;
case 'bShowHorAxTitle':
if (hBarChart) {
chartProps.setDisplayAxisTitles(VertAxis?.getLabel() === 1, SecVertAxis?.getLabel() === 1, item.checked, SecHorAxis?.getLabel() === 1, DepthAxis?.getLabel() === 1);
} else if (scatterChart) {
chartProps.setDisplayAxisTitles(SecHorAxis?.getLabel() === 1, SecVertAxis?.getLabel() === 1, item.checked, VertAxis?.getLabel() === 1, DepthAxis?.getLabel() === 1);
} else if (type === 38) {
chartProps.setDisplayAxisTitles(item.checked, SecVertAxis?.getLabel() === 1, VertAxis?.getLabel() === 1, SecHorAxis?.getLabel() === 1, DepthAxis?.getLabel() === 1);
} else {
chartProps.setDisplayAxisTitles(item.checked, SecHorAxis?.getLabel() === 1, VertAxis?.getLabel() === 1, SecVertAxis?.getLabel() === 1, DepthAxis?.getLabel() === 1);
}
break;
case 'bShowVertAxTitle':
if (hBarChart) {
chartProps.setDisplayAxisTitles(item.checked, SecVertAxis?.getLabel() === 1, HorAxis?.getLabel() === 1, SecHorAxis?.getLabel() === 1, DepthAxis?.getLabel() === 1);
} else if (scatterChart) {
chartProps.setDisplayAxisTitles(SecHorAxis?.getLabel() === 1, SecVertAxis?.getLabel() === 1, HorAxis?.getLabel() === 1, item.checked, DepthAxis?.getLabel() === 1);
} else if (type === 38) {
chartProps.setDisplayAxisTitles(HorAxis?.getLabel() === 1, SecVertAxis?.getLabel() === 1, item.checked, SecHorAxis?.getLabel() === 1, DepthAxis?.getLabel() === 1);
} else {
chartProps.setDisplayAxisTitles(HorAxis?.getLabel() === 1, SecHorAxis?.getLabel() === 1, item.checked, SecVertAxis?.getLabel() === 1, DepthAxis?.getLabel() === 1);
}
break;
case 'bShowHorAxTitleSec':
if (type === 38) {
chartProps.setDisplayAxisTitles(HorAxis?.getLabel() === 1, SecVertAxis?.getLabel() === 1, VertAxis?.getLabel() === 1, item.checked, DepthAxis?.getLabel() === 1);
} else {
chartProps.setDisplayAxisTitles(HorAxis?.getLabel() === 1, item.checked, VertAxis?.getLabel() === 1, SecVertAxis?.getLabel() === 1, DepthAxis?.getLabel() === 1);
}
break;
case 'bShowVertAxisTitleSec':
if (type === 38) {
chartProps.setDisplayAxisTitles(HorAxis?.getLabel() === 1, item.checked, VertAxis?.getLabel() === 1, SecHorAxis?.getLabel() === 1, DepthAxis?.getLabel() === 1);
} else {
chartProps.setDisplayAxisTitles(HorAxis?.getLabel() === 1, SecHorAxis?.getLabel() === 1, VertAxis?.getLabel() === 1, item.checked, DepthAxis?.getLabel() === 1);
}
case 'bShowDepthAxisTitle':
chartProps.setDisplayAxes(HorAxis?.getLabel() === 1, SecHorAxis?.getLabel() === 1, VertAxis?.getLabel() === 1, SecVertAxis?.getLabel() === 1, item.checked);
break;
case 'bShowChartTitleNone':
chartProps.setDisplayChartTitle(false, false);
break;
case 'bShowChartTitle':
chartProps.setDisplayChartTitle(true, false);
break;
case 'bOverlayTitle':
chartProps.setDisplayChartTitle(true, true);
break;
case 'CenterData':
chartProps.setDisplayDataLabels(true, Asc.c_oAscChartDataLabelsPos.ctr);
break;
case 'InnerBottomData':
chartProps.setDisplayDataLabels(true, Asc.c_oAscChartDataLabelsPos.inBase);
break;
case 'InnerTopData':
chartProps.setDisplayDataLabels(true, Asc.c_oAscChartDataLabelsPos.inEnd);
break;
case 'OuterTopData':
chartProps.setDisplayDataLabels(true, Asc.c_oAscChartDataLabelsPos.outEnd);
break;
case 'TopData':
chartProps.setDisplayDataLabels(true, Asc.c_oAscChartDataLabelsPos.t);
break;
case 'LeftData':
chartProps.setDisplayDataLabels(true, Asc.c_oAscChartDataLabelsPos.l);
break;
case 'RightData':
chartProps.setDisplayDataLabels(true, Asc.c_oAscChartDataLabelsPos.r);
break;
case 'BottomData':
chartProps.setDisplayDataLabels(true, Asc.c_oAscChartDataLabelsPos.b);
break;
case 'FitWidthData':
chartProps.setDisplayDataLabels(true, Asc.c_oAscChartDataLabelsPos.bestFit);
break;
case 'bShowDataLabels':
chartProps.setDisplayDataLabels(false, false);
break;
// case 'bShowDataNone':
// chartProps.setDisplayDataTable(false, false);
// break;
// case 'bShowDataTable':
// chartProps.setDisplayDataTable(true, false);
// break;
// case 'bShowLegendKeys':
// chartProps.setDisplayDataTable(true, true);
// break;
case 'standardError':
chartProps.setDisplayErrorBars(true, 4);
break;
case 'percentage':
chartProps.setDisplayErrorBars(true, 2);
break;
case 'standardDeviation':
chartProps.setDisplayErrorBars(true, 3);
break;
case 'bShowHorMajor':
if (hBarChart) {
chartProps.setDisplayGridlines(HorMajorGridlines, item.checked, HorMinorGridlines, VertMinorGridlines);
} else
chartProps.setDisplayGridlines(item.checked, HorMajorGridlines, VertMinorGridlines, HorMinorGridlines);
break;
case 'bShowVerMajor':
if (hBarChart || RadarChart) {
chartProps.setDisplayGridlines(item.checked, VertMajorGridlines, HorMinorGridlines, VertMinorGridlines);
} else
chartProps.setDisplayGridlines(VertMajorGridlines, item.checked, VertMinorGridlines, HorMinorGridlines);
break;
case 'bShowHorMinor':
if (hBarChart) {
chartProps.setDisplayGridlines(HorMajorGridlines, VertMajorGridlines, HorMinorGridlines, item.checked);
} else
chartProps.setDisplayGridlines(VertMajorGridlines, HorMajorGridlines, item.checked, HorMinorGridlines);
break;
case 'bShowVerMinor':
if (hBarChart || RadarChart) {
chartProps.setDisplayGridlines(HorMajorGridlines, VertMajorGridlines, item.checked, VertMinorGridlines);
}else
chartProps.setDisplayGridlines(VertMajorGridlines, HorMajorGridlines, VertMinorGridlines, item.checked);
break;
case 'LeftLegend':
if (chartProps.getLegendPos() === 1) {
chartProps.setDisplayLegend(false, 0);
} else {
chartProps.setDisplayLegend(true, 1);
}
break;
case 'TopLegend':
if (chartProps.getLegendPos() === 2) {
chartProps.setDisplayLegend(false, 0);
} else {
chartProps.setDisplayLegend(true, 2);
}
break;
case 'RightLegend':
if (chartProps.getLegendPos() === 3) {
chartProps.setDisplayLegend(false, 0);
} else {
chartProps.setDisplayLegend(true, 3);
}
break;
case 'BottomLegend':
if (chartProps.getLegendPos() === 4) {
chartProps.setDisplayLegend(false, 0);
} else {
chartProps.setDisplayLegend(true, 4);
}
break;
case 'trendLineNone':
chartProps.setDisplayTrendlines(false, false, 0, 0);
break;
case 'trendLineLinear':
chartProps.setDisplayTrendlines(true, 1, 0, 0);
break;
case 'trendLineExponential':
chartProps.setDisplayTrendlines(true, 0, 0, 0);
break;
case 'trendLineForecast':
chartProps.setDisplayTrendlines(true, 1, 2, 0);
break;
case 'trendLineMovingAverage':
chartProps.setDisplayTrendlines(true, 3, 0, 0);
break;
case 'bShowUpDownBars':
chartProps.setDisplayUpDownBars(true);
break;
case 'bShowUpDownNone':
chartProps.setDisplayUpDownBars(false);
break;
}
};
dh.updateChartElementMenu = function(menu, chartProps) {
const type = chartProps.getType(),
ComboChart = [38, 39, 40, 41].includes(type),
RadarChart = [42, 43, 44].includes(type);
let LabelGroup1 = [0, 1, 2, 16, 17, 18].includes(type),
LabelGroup2 = [0, 1, 2, 14, 15, 16, 17, 18].includes(type),
LabelGroup3 = [0, 14, 15, 16].includes(type),
LabelGroup4 = [7, 8, 9, 10, 11, 12, 26, 27, 28, 29, 32, 33].includes(type),
LabelGroup5 = [14, 15].includes(type);
if (ComboChart) {
const comboType = chartProps.getSeries()?.[0]?.asc_getChartType(),
isInGroup1 = [0, 1, 2, 16, 17, 18].includes(comboType),
isInGroup2 = [0, 1, 2, 14, 15, 16, 17, 18].includes(comboType),
isInGroup3 = [0, 14, 15, 16].includes(comboType),
isInGroup4 = [7, 8, 9, 10, 11, 12, 26, 27, 28, 29, 32, 33].includes(comboType),
isInGroup5 = [14, 15].includes(comboType);
LabelGroup1 = isInGroup1;
LabelGroup2 = isInGroup2;
LabelGroup3 = isInGroup3;
LabelGroup4 = isInGroup4;
LabelGroup5 = isInGroup5;
}
const axesMenu = menu.items[0].menu;
axesMenu.items[0].setVisible(!RadarChart);
axesMenu.items[0].setChecked(!RadarChart && chartProps.getHorAxesProps()?.[0]?.getShow());
axesMenu.items[1].setChecked(chartProps.getVertAxesProps()?.[0]?.getShow());
axesMenu.items[4].setVisible(chartProps.getDepthAxesProps()?.[0]);
axesMenu.items[4].setChecked(chartProps.getDepthAxesProps()?.[0]?.getShow());
if (ComboChart) {
axesMenu.items[2].setVisible(chartProps.getHorAxesProps()?.[1]);
axesMenu.items[2].setChecked(chartProps.getHorAxesProps()?.[1]?.getShow());
axesMenu.items[3].setVisible(chartProps.getVertAxesProps()?.[1]);
axesMenu.items[3].setChecked(chartProps.getVertAxesProps()?.[1]?.getShow());
} else {
axesMenu.items[2].setVisible(false);
axesMenu.items[3].setVisible(false);
}
const titlesMenu = menu.items[1].menu;
titlesMenu.items[0].setChecked(chartProps.getHorAxesProps()?.[0]?.getLabel() === 1);
titlesMenu.items[1].setChecked(chartProps.getVertAxesProps()?.[0]?.getLabel() === 1);
titlesMenu.items[4].setVisible(chartProps.getDepthAxesProps()?.[0]);
titlesMenu.items[4].setChecked(chartProps.getDepthAxesProps()?.[0]?.getLabel() === 1);
if (ComboChart) {
titlesMenu.items[2].setVisible(chartProps.getHorAxesProps()?.[1]);
titlesMenu.items[2].setChecked(chartProps.getHorAxesProps()?.[1]?.getLabel() === 1);
titlesMenu.items[3].setVisible(chartProps.getVertAxesProps()?.[1]);
titlesMenu.items[3].setChecked(chartProps.getVertAxesProps()?.[1]?.getLabel() === 1);
} else {
titlesMenu.items[2].setVisible(false);
titlesMenu.items[3].setVisible(false);
}
const titleMenu = menu.items[2].menu;
highlightSubmenuItem(titleMenu.items[0], chartProps.getTitle() === 0, 'chartTitle');
highlightSubmenuItem(titleMenu.items[1], chartProps.getTitle() === 2, 'chartTitle');
highlightSubmenuItem(titleMenu.items[2], chartProps.getTitle() === 1, 'chartTitle');
const labelsMenu = menu.items[3].menu;
highlightSubmenuItem(labelsMenu.items[0], chartProps.getDataLabelsPos() === Asc.c_oAscChartDataLabelsPos.none, 'labels');
highlightSubmenuItem(labelsMenu.items[1], chartProps.getDataLabelsPos() === Asc.c_oAscChartDataLabelsPos.ctr, 'labels');
highlightSubmenuItem(labelsMenu.items[2], LabelGroup1 && chartProps.getDataLabelsPos() === Asc.c_oAscChartDataLabelsPos.inBase, 'labels');
highlightSubmenuItem(labelsMenu.items[3], LabelGroup2 && chartProps.getDataLabelsPos() === Asc.c_oAscChartDataLabelsPos.inEnd, 'labels');
highlightSubmenuItem(labelsMenu.items[4], LabelGroup3 && chartProps.getDataLabelsPos() === Asc.c_oAscChartDataLabelsPos.outEnd, 'labels');
highlightSubmenuItem(labelsMenu.items[5], LabelGroup4 && chartProps.getDataLabelsPos() === Asc.c_oAscChartDataLabelsPos.t, 'labels');
highlightSubmenuItem(labelsMenu.items[6], LabelGroup4 && chartProps.getDataLabelsPos() === Asc.c_oAscChartDataLabelsPos.l, 'labels');
highlightSubmenuItem(labelsMenu.items[7], LabelGroup4 && chartProps.getDataLabelsPos() === Asc.c_oAscChartDataLabelsPos.r, 'labels');
highlightSubmenuItem(labelsMenu.items[8], LabelGroup4 && chartProps.getDataLabelsPos() === Asc.c_oAscChartDataLabelsPos.b, 'labels');
highlightSubmenuItem(labelsMenu.items[9], LabelGroup5 && chartProps.getDataLabelsPos() === Asc.c_oAscChartDataLabelsPos.bestFit, 'labels');
if (chartProps.getDataLabelsPos() !== undefined) {
labelsMenu.items[2].setVisible(LabelGroup1);
labelsMenu.items[3].setVisible(LabelGroup2);
labelsMenu.items[4].setVisible(LabelGroup3);
labelsMenu.items[5].setVisible(LabelGroup4);
labelsMenu.items[6].setVisible(LabelGroup4);
labelsMenu.items[7].setVisible(LabelGroup4);
labelsMenu.items[8].setVisible(LabelGroup4);
labelsMenu.items[9].setVisible(LabelGroup5);
}
// const tableMenu = menu.items[4].menu;
// highlightSubmenuItem(tableMenu.items[0], false, 'table');
// highlightSubmenuItem(tableMenu.items[1], false, 'table');
// highlightSubmenuItem(tableMenu.items[2], false,'table');
const gridMenu = menu.items[5].menu;
gridMenu.items[0].setVisible(true);
gridMenu.items[2].setVisible(true);
if (RadarChart) {
gridMenu.items[0].setVisible(false);
gridMenu.items[0].setChecked(false);
gridMenu.items[1].setChecked(chartProps.getVertAxesProps()?.[0]?.getGridlines() === 1 || chartProps.getVertAxesProps()?.[0]?.getGridlines() === 3);
gridMenu.items[2].setChecked(false);
gridMenu.items[2].setVisible(false);
gridMenu.items[3].setChecked(chartProps.getVertAxesProps()?.[0]?.getGridlines() === 2 || chartProps.getVertAxesProps()?.[0]?.getGridlines() === 3);
} else if (type !== 14 && type !== 15) {
gridMenu.items[0].setChecked(chartProps.getVertAxesProps()?.[0]?.getGridlines() === 1 || chartProps.getVertAxesProps()?.[0]?.getGridlines() === 3);
gridMenu.items[1].setChecked(chartProps.getHorAxesProps()?.[0]?.getGridlines() === 1 || chartProps.getHorAxesProps()?.[0]?.getGridlines() === 3);
gridMenu.items[2].setChecked(chartProps.getVertAxesProps()?.[0]?.getGridlines() === 2 || chartProps.getVertAxesProps()?.[0]?.getGridlines() === 3);
gridMenu.items[3].setChecked(chartProps.getHorAxesProps()?.[0]?.getGridlines() === 2 || chartProps.getHorAxesProps()?.[0]?.getGridlines() === 3);
}
const legendMenu = menu.items[6].menu;
highlightSubmenuItem(legendMenu.items[0],chartProps.getLegendPos() === 2, 'legend');
highlightSubmenuItem(legendMenu.items[1],chartProps.getLegendPos() === 1, 'legend');
highlightSubmenuItem(legendMenu.items[2],chartProps.getLegendPos() === 3, 'legend');
highlightSubmenuItem(legendMenu.items[3],chartProps.getLegendPos() === 4, 'legend');
const supportedElements = chartElementMap[type] || chartElementMap[45] || [];
menu.items.forEach(function(item) {
item.setDisabled(supportedElements.indexOf(item.value) === -1);
});
};
dh.onSingleChartSelectionChanged = function(asc_CRect) {
var me = this,
documentHolderView = me.documentHolder,
chartContainer = documentHolderView.cmpEl.find('#chart-element-container');
me.getCurrentChartProps = function() {
var selectedObjects = me.api.asc_getGraphicObjectProps();
for (var i = 0; i < selectedObjects.length; i++) {
if (selectedObjects[i].asc_getObjectType() == Asc.c_oAscTypeSelectElement.Image) {
var elValue = selectedObjects[i].asc_getObjectValue();
if (elValue.asc_getChartProperties()) {
return elValue.asc_getChartProperties();
}
}
}
return null;
};
me.chartProps = me.getCurrentChartProps();
if (chartContainer.length < 1) {
chartContainer = $('<div id="chart-element-container" style="position: absolute; z-index: 1000;"><div id="id-document-holder-btn-chart-element"></div></div>');
documentHolderView.cmpEl.find('#ws-canvas-outer').append(chartContainer);
}
this.isRtlSheet = this.api ? !!this.api.asc_getSheetViewSettings().asc_getRightToLeft() : false;
if (me.chartProps) {
var x = asc_CRect.asc_getX(),
y = asc_CRect.asc_getY(),
width = asc_CRect.asc_getWidth(),
sheetWidth = me.tooltips.coauth.bodyWidth - me.tooltips.coauth.XY[0] - me.tooltips.coauth.rightMenuWidth - 15,
sheetHeight = me.tooltips.coauth.apiHeight - 15,
btnLeft = this.isRtlSheet ? x - 95 : x + width + 10,
btnTop = y;
if (btnLeft + 50 > sheetWidth) {
btnLeft = x - 40;
}
if (btnLeft < 25) {
if (this.isRtlSheet){
btnLeft = x + width - 40;
} else {
chartContainer.hide();
return;
}
}
if (btnTop + 30 > sheetHeight) {
chartContainer.hide();
return;
}
if (btnTop < 20) {
btnTop = 20;
}
chartContainer.css({
left: btnLeft + 'px',
top: btnTop + 'px'
}).show();
if (!me.btnChartElement) {
me.btnChartElement = new Common.UI.Button({
parentEl: $('#id-document-holder-btn-chart-element'),
cls: 'btn-toolbar',
iconCls: 'toolbar__icon btn-chart-elements',
menu: this.documentHolder.menuChartElement.menu
});
me.btnChartElement.on('click', function() {
me.chartProps = me.getCurrentChartProps();
if (me.chartProps) {
me.updateChartElementMenu(me.documentHolder.menuChartElement.menu, me.chartProps);
}
});
}
} else {
chartContainer.hide();
}
};
dh.onShowSpecialPasteOptions = function(specialPasteShowOptions) {
if (this.mode && !this.mode.isEdit) return;

View File

@ -1039,6 +1039,314 @@ define([], function () {
})
});
me.menuChartElement = new Common.UI.MenuItem({
menu: new Common.UI.Menu({
cls: 'shifted-right',
menuAlign: 'tl-tr',
items: [
{
caption: me.textAxes,
value: 'axes',
disabled: false,
menu: new Common.UI.Menu({
cls: 'shifted-right',
menuAlign: 'tl-tr',
items: [
{
caption: me.textHorAxis,
value: 'bShowHorAxis',
checkable: true
},
{
caption: me.textVertAxis,
value: 'bShowVertAxis',
checkable: true
},
{
caption: me.textHorAxisSec,
value: 'bShowHorAxSec',
checkable: true
},
{
caption: me.textVertAxisSec,
value: 'bShowVertAxSec',
checkable: true
},
{
caption: me.DepthAxis,
value: 'bShowDepthAxes',
checkable: true
}
]
})
},
{
caption: me.textAxisTitles,
value: 'axisTitles',
disabled: false,
menu: new Common.UI.Menu({
cls: 'shifted-right',
menuAlign: 'tl-tr',
items: [
{
caption: me.textHorAxis,
value: 'bShowHorAxTitle',
checkable: true
},
{
caption: me.textVertAxis,
value: 'bShowVertAxTitle',
checkable: true
},
{
caption: me.textHorAxisSec,
value: 'bShowHorAxTitleSec',
checkable: true
},
{
caption: me.textVertAxisSec,
value: 'bShowVertAxisTitleSec',
checkable: true
}
]
})
},
{
caption: me.textChartTitle,
value: 'chartTitle',
disabled: false,
menu: new Common.UI.Menu({
cls: 'shifted-right',
menuAlign: 'tl-tr',
items: [
{
caption: me.textNone,
value: 'bShowChartTitleNone',
disabled: false
},
{
caption: me.textNoOverlay,
value: 'bShowChartTitle',
},
{
caption: me.textOverlay,
value: 'bOverlayTitle'
}
]
})
},
{
caption: me.textDataLabels,
value: 'dataLabels',
disabled: false,
menu: new Common.UI.Menu({
cls: 'shifted-right',
menuAlign: 'tl-tr',
items: [
{
caption: me.textNone,
value: 'bShowDataLabels'
},
{
caption: me.textCenter,
value: 'CenterData'
},
{
caption: me.textInnerBottom,
value: 'InnerBottomData'
},
{
caption: me.textInnerTop,
value: 'InnerTopData'
},
{
caption: me.textOuterTop,
value: 'OuterTopData'
},
{
caption: me.textTop,
value: 'TopData'
},
{
caption: me.textLeftData,
value: 'LeftData'
},
{
caption: me.textRight,
value: 'RightData'
},
{
caption: me.textBottom,
value: 'BottomData'
},
{
caption: me.textFit,
value: 'FitWidthData'
}
]
})
},
// {
// caption: me.textDataTable,
// value: 'dataTable',
// disabled: false,
// menu: new Common.UI.Menu({
// cls: 'shifted-right',
// menuAlign: 'tl-tr',
// items: [
// {
// caption: me.textNone,
// value: 'bShowDataNone'
// },
// {
// caption: me.textShowDataTable,
// value: 'bShowDataTable'
// },
// {
// caption: me.textShowLegendKeys,
// value: 'bShowLegendKeys'
// }
// ]
// })
// },
{
caption: me.textErrorBars,
value: 'errorBars',
disabled: false,
menu: new Common.UI.Menu({
cls: 'shifted-right',
menuAlign: 'tl-tr',
items: [
{
caption: me.textStandardError,
value: 'standardError',
disabled: false
},
{
caption: me.txtPercentage,
value: 'percentage',
disabled: false
},
{
caption: me.textStandardDeviation,
value: 'standardDeviation',
disabled: false
}
]
})
},
{
caption: me.textGridLines,
value: 'gridLines',
disabled: false,
menu: new Common.UI.Menu({
cls: 'shifted-right',
menuAlign: 'tl-tr',
items: [
{
caption: me.textHorizontalMajor,
value: 'bShowHorMajor',
checkable: true
},
{
caption: me.textVerticalMajor,
value: 'bShowVerMajor',
checkable: true
},
{
caption: me.textHorizontalMinor,
value: 'bShowHorMinor',
checkable: true
},
{
caption: me.textVerticalMinor,
value: 'bShowVerMinor',
checkable: true
}
]
})
},
{
caption: me.textLegendPos,
value: 'legend',
disabled: false,
menu: new Common.UI.Menu({
cls: 'shifted-right',
menuAlign: 'tl-tr',
items: [
{
caption: me.textTop,
value: 'TopLegend'
},
{
caption: me.textLeft,
value: 'LeftLegend'
},
{
caption: me.textRight,
value: 'RightLegend'
},
{
caption: me.textBottom,
value: 'BottomLegend'
}
]
})
},
{
caption: me.textTrendline,
value: 'trendLines',
disabled: false,
menu: new Common.UI.Menu({
cls: 'shifted-right',
menuAlign: 'tl-tr',
items: [
{
caption: me.textNone,
value: 'trendLineNone'
},
{
caption: me.textLinear,
value: 'trendLineLinear'
},
{
caption: me.textExponential,
value: 'trendLineExponential'
},
{
caption: me.textLinearForecast,
value: 'trendLineForecast'
},
{
caption: me.textMovingAverage,
value: 'trendLineMovingAverage'
}
]
})
},
{
caption: me.textUpDownBars,
value: 'upDownBars',
disabled: false,
menu: new Common.UI.Menu({
cls: 'shifted-right',
menuAlign: 'tl-tr',
items: [
{
caption: me.textNone,
value: 'bShowUpDownNone'
},
{
caption: me.textShowUpDown,
value: 'bShowUpDownBars'
}
]
})
}
]
})
});
me.menuChartEdit = new Common.UI.MenuItem({
caption : me.editChartText
});

View File

@ -2025,6 +2025,46 @@
"PE.Views.DocumentHolder.txtWarnUrl": "Clicking this link can be harmful to your device and data.<br>Are you sure you want to continue?",
"PE.Views.DocumentHolder.unicodeText": "Unicode",
"PE.Views.DocumentHolder.vertAlignText": "Vertical alignment",
"PE.Views.DocumentHolder.textAxes": "Axes",
"PE.Views.DocumentHolder.DepthAxis": "Z axis",
"PE.Views.DocumentHolder.textAxisTitles": "Axis Titles",
"PE.Views.DocumentHolder.textChartTitle": "Chart Title",
"PE.Views.DocumentHolder.textDataTable": "Data Table",
"PE.Views.DocumentHolder.textErrorBars": "Error Bars",
"PE.Views.DocumentHolder.textLines": "Lines",
"PE.Views.DocumentHolder.textTrendline": "Trendline",
"PE.Views.DocumentHolder.textUpDownBars": " Up/Down Bars",
"PE.Views.DocumentHolder.textShowLegendKeys": "Show Legend Keys",
"PE.Views.DocumentHolder.textShowDataTable": "Show Data Table",
"PE.Views.DocumentHolder.textStandardError": "Standard Error",
"PE.Views.DocumentHolder.textStandardDeviation": "Standard Deviation",
"PE.Views.DocumentHolder.textHorizontalMajor": "Horizontal Major",
"PE.Views.DocumentHolder.textVerticalMajor": "Vertical Major",
"PE.Views.DocumentHolder.textHorizontalMinor": "Horizontal Minor",
"PE.Views.DocumentHolder.textVerticalMinor": "Vertical Minor",
"PE.Views.DocumentHolder.textLinear": "Linear",
"PE.Views.DocumentHolder.textExponential": "Exponential",
"PE.Views.DocumentHolder.textLinearForecast": "Linear Forecast",
"PE.Views.DocumentHolder.textMovingAverage": "Moving Average (2)",
"PE.Views.DocumentHolder.textShowUpDown": "Show Up/Down Bars",
"PE.Views.DocumentHolder.textHorAxis": "Horizontal axis",
"PE.Views.DocumentHolder.textHorAxisSec": "Secondary horizontal axis",
"PE.Views.DocumentHolder.textVertAxis": "Vertical axis",
"PE.Views.DocumentHolder.textVertAxisSec": "Secondary vertical axis",
"PE.Views.DocumentHolder.textNoOverlay": "No overlay",
"PE.Views.DocumentHolder.textOverlay": "Overlay",
"PE.Views.DocumentHolder.textDataLabels": "Data labels",
"PE.Views.DocumentHolder.textCenter": "Center",
"PE.Views.DocumentHolder.textInnerBottom": "Inner bottom",
"PE.Views.DocumentHolder.textInnerTop": "Inner top",
"PE.Views.DocumentHolder.textOuterTop": "Outer top",
"PE.Views.DocumentHolder.textTop": "Top",
"PE.Views.DocumentHolder.textLeftData": "Left",
"PE.Views.DocumentHolder.textRight": "Right",
"PE.Views.DocumentHolder.textBottom": "Bottom",
"PE.Views.DocumentHolder.textFit": "Fit to width",
"PE.Views.DocumentHolder.textGridLines": "Gridlines",
"PE.Views.DocumentHolder.textLegendPos": "Legend",
"PE.Views.DocumentPreview.goToSlideText": "Go to slide",
"PE.Views.DocumentPreview.slideIndexText": "Slide {0} of {1}",
"PE.Views.DocumentPreview.txtClose": "Close slideshow",