Skip to content

Commit

Permalink
Make percentage axis (secondary y axis) optional (not enabled by defa…
Browse files Browse the repository at this point in the history
…ult)

Issue: #3006
  • Loading branch information
buchen committed May 30, 2023
1 parent c62f1b4 commit b0f5b93
Show file tree
Hide file tree
Showing 15 changed files with 78 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ public class Messages extends NLS
public static String LabelChartDetailSettingsShowMarkerLines;
public static String LabelChartDetailSettingsShowDataLabel;
public static String LabelChartDetailSettingsShowMissingTradingDays;
public static String LabelChartDetailSettingsShowPercentageAxis;
public static String LabelChartShowLabels;
public static String LabelChartType;
public static String LabelCleanHTML;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1132,18 +1132,20 @@ LabelChartDetailMovingAverage_90days = 90 days

LabelChartDetailSettings = Settings

LabelChartDetailSettingsShowDataLabel = Show data labels

LabelChartDetailSettingsShowHorizontalLinesMain = Horizontal lines (Value axis)

LabelChartDetailSettingsShowHorizontalLinesPercentage = Horizontal lines (Percentage axis)

LabelChartDetailSettingsShowDataLabel = Show data labels

LabelChartDetailSettingsShowLimits = Show limits

LabelChartDetailSettingsShowMarkerLines = Show with marker lines

LabelChartDetailSettingsShowMissingTradingDays = Show missing trading days

LabelChartDetailSettingsShowPercentageAxis = Percentage axis (secondary)

LabelChartShowLabels = Show labels

LabelChartType = Chart type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1120,18 +1120,20 @@ LabelChartDetailMovingAverage_90days = 90 dn\u016F

LabelChartDetailSettings = Nastaven\u00ED

LabelChartDetailSettingsShowDataLabel = Zobrazit popisky dat

LabelChartDetailSettingsShowHorizontalLinesMain = Vodorovn\u00E9 \u010D\u00E1ry (osa hodnot)

LabelChartDetailSettingsShowHorizontalLinesPercentage = Vodorovné \u010D\u00E1ry (procentu\u00E1ln\u00ED osa)

LabelChartDetailSettingsShowDataLabel = Zobrazit popisky dat
LabelChartDetailSettingsShowHorizontalLinesPercentage = Vodorovn\u00E9 \u010D\u00E1ry (procentu\u00E1ln\u00ED osa)

LabelChartDetailSettingsShowLimits = Zobrazit limity

LabelChartDetailSettingsShowMarkerLines = Zobrazit pomoc\u00ED zna\u010Dkovac\u00EDch \u010Dar

LabelChartDetailSettingsShowMissingTradingDays = Zobrazit chyb\u011Bj\u00EDc\u00ED obchodn\u00ED dny

LabelChartDetailSettingsShowPercentageAxis = Procentn\u00ED osa (sekund\u00E1rn\u00ED)

LabelChartShowLabels = Zobrazit popisky

LabelChartType = Typ grafu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1121,12 +1121,18 @@ LabelChartDetailSettings = Ops\u00E6tninger
LabelChartDetailSettingsShowDataLabel = Vis datalabler
LabelChartDetailSettingsShowHorizontalLinesMain = Vandrette linjer (v\u00E6rdiakse)
LabelChartDetailSettingsShowHorizontalLinesPercentage = Vandrette linjer (procentvis akse)
LabelChartDetailSettingsShowLimits = Vis begr\u00E6nsninger
LabelChartDetailSettingsShowMarkerLines = Vis med markeringslinier
LabelChartDetailSettingsShowMissingTradingDays = Vis manglende handelsdage
LabelChartDetailSettingsShowPercentageAxis = Procentakse (sekund\u00E6r)
LabelChartShowLabels = Vis labler
LabelChartType = Diagram type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1119,18 +1119,20 @@ LabelChartDetailMovingAverage_90days = 90 Tage

LabelChartDetailSettings = Einstellungen

LabelChartDetailSettingsShowDataLabel = Zahlenwerte anzeigen

LabelChartDetailSettingsShowHorizontalLinesMain = Horizontale Linien (Werte-Achse)

LabelChartDetailSettingsShowHorizontalLinesPercentage = Horizontale Linien (Prozent-Achse)

LabelChartDetailSettingsShowDataLabel = Zahlenwerte anzeigen

LabelChartDetailSettingsShowLimits = Zeige Limits

LabelChartDetailSettingsShowMarkerLines = Darstellung mit Markierungslinien

LabelChartDetailSettingsShowMissingTradingDays = Zeige fehlende Handelstage

LabelChartDetailSettingsShowPercentageAxis = Prozent-Achse (sekund\u00E4r)

LabelChartShowLabels = Beschriftungen anzeigen

LabelChartType = Diagramm Typ
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1119,18 +1119,20 @@ LabelChartDetailMovingAverage_90days = 90 d\u00EDas

LabelChartDetailSettings = Opini\u00F3n

LabelChartDetailSettingsShowDataLabel = Mostrar etiquetas de datos

LabelChartDetailSettingsShowHorizontalLinesMain = L\u00EDneas horizontales (eje del valor)

LabelChartDetailSettingsShowHorizontalLinesPercentage = L\u00EDneas horizontales (eje porcentual)

LabelChartDetailSettingsShowDataLabel = Mostrar etiquetas de datos

LabelChartDetailSettingsShowLimits = Mostrar l\u00EDmites

LabelChartDetailSettingsShowMarkerLines = Mostrar con l\u00EDneas de marcador

LabelChartDetailSettingsShowMissingTradingDays = Mostrar los d\u00EDas de comercio faltantes

LabelChartDetailSettingsShowPercentageAxis = Eje porcentual (secundario)

LabelChartShowLabels = Mostrar etiquetas

LabelChartType = Tipo de gr\u00E1fico
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1120,18 +1120,20 @@ LabelChartDetailMovingAverage_90days = 90 jours

LabelChartDetailSettings = Param\u00E8tres

LabelChartDetailSettingsShowDataLabel = Afficher \u00E9tiquettes de donn\u00E9es

LabelChartDetailSettingsShowHorizontalLinesMain = Lignes horizontales (axe des valeurs)

LabelChartDetailSettingsShowHorizontalLinesPercentage = Lignes horizontales (axe des pourcentages)

LabelChartDetailSettingsShowDataLabel = Afficher \u00E9tiquettes de donn\u00E9es

LabelChartDetailSettingsShowLimits = = Afficher les limites

LabelChartDetailSettingsShowMarkerLines = Afficher les lignes de marqueurs

LabelChartDetailSettingsShowMissingTradingDays = Afficher les jours de bourse manquants

LabelChartDetailSettingsShowPercentageAxis = Axe des pourcentages (secondaire)

LabelChartShowLabels = Afficher \u00E9tiquettes

LabelChartType = Type de graphe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1119,18 +1119,20 @@ LabelChartDetailMovingAverage_90days = 90 giorni

LabelChartDetailSettings = Impostazioni

LabelChartDetailSettingsShowDataLabel = Mostra etichette dati

LabelChartDetailSettingsShowHorizontalLinesMain = Linee orizzontali (asse del valore)

LabelChartDetailSettingsShowHorizontalLinesPercentage = Linee orizzontali (asse percentuale)

LabelChartDetailSettingsShowDataLabel = Mostra etichette dati

LabelChartDetailSettingsShowLimits = Mostra limiti

LabelChartDetailSettingsShowMarkerLines = Mostra con linee di marcatura

LabelChartDetailSettingsShowMissingTradingDays = Mostra giorni negoziazione mancanti

LabelChartDetailSettingsShowPercentageAxis = Asse percentuale (secondario)

LabelChartShowLabels = Mostra etichette

LabelChartType = Tipo grafico
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1119,18 +1119,20 @@ LabelChartDetailMovingAverage_90days = 90 dagen
LabelChartDetailSettings = Instelling
LabelChartDetailSettingsShowDataLabel = Toon datalabels
LabelChartDetailSettingsShowHorizontalLinesMain = Horizontale lijnen (waarde-as)
LabelChartDetailSettingsShowHorizontalLinesPercentage = Horizontale lijnen (percentage-as)
LabelChartDetailSettingsShowDataLabel = Toon datalabels
LabelChartDetailSettingsShowLimits = = Toon Grenzen
LabelChartDetailSettingsShowMarkerLines = Weergeven met markeringslijnen
LabelChartDetailSettingsShowMissingTradingDays = Toon ontbrekende handelsdagen
LabelChartDetailSettingsShowPercentageAxis = Procentuele as (secundair)
LabelChartShowLabels = Toon labels
LabelChartType = Grafiektype
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1121,12 +1121,18 @@ LabelChartDetailSettings = Ustawienia

LabelChartDetailSettingsShowDataLabel = Poka\u017C etykiety danych

LabelChartDetailSettingsShowHorizontalLinesMain = Linie poziome (o\u015B warto\u015Bci)

LabelChartDetailSettingsShowHorizontalLinesPercentage = Linie poziome (o\u015B procentowa)

LabelChartDetailSettingsShowLimits = Poka\u017C limity

LabelChartDetailSettingsShowMarkerLines = Poka\u017C z liniami znacznik\u00F3w

LabelChartDetailSettingsShowMissingTradingDays = Poka\u017C brakuj\u0105ce dni handlowe

LabelChartDetailSettingsShowPercentageAxis = O\u015B procentowa (drugorz\u0119dna)

LabelChartShowLabels = Poka\u017C etykiety

LabelChartType = Typ wykresu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1119,18 +1119,20 @@ LabelChartDetailMovingAverage_90days = 90 dias

LabelChartDetailSettings = Defini\u00E7\u00F5es

LabelChartDetailSettingsShowDataLabel = Mostrar r\u00F3tulos de dados

LabelChartDetailSettingsShowHorizontalLinesMain = Linhas horizontais (Eixo de valor)

LabelChartDetailSettingsShowHorizontalLinesPercentage = Linhas horizontais (Eixo percentual)

LabelChartDetailSettingsShowDataLabel = Mostrar r\u00F3tulos de dados

LabelChartDetailSettingsShowLimits = = Mostrar limites

LabelChartDetailSettingsShowMarkerLines = Mostrar com linhas de marcador

LabelChartDetailSettingsShowMissingTradingDays = Mostrar dias de negocia\u00E7\u00E3o ausentes

LabelChartDetailSettingsShowPercentageAxis = Eixo das percentagens (secund\u00E1rio)

LabelChartShowLabels = Mostrar r\u00F3tulos

LabelChartType = Avalia\u00E7\u00E3o
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1119,18 +1119,20 @@ LabelChartDetailMovingAverage_90days = 90 \u0434\u043D\u0435\u0439

LabelChartDetailSettings = \u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438

LabelChartDetailSettingsShowDataLabel = \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043C\u0435\u0442\u043A\u0438 \u0434\u0430\u043D\u043D\u044B\u0445

LabelChartDetailSettingsShowHorizontalLinesMain = \u0413\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u044B\u0435 \u043B\u0438\u043D\u0438\u0438 (\u043E\u0441\u044C \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439)

LabelChartDetailSettingsShowHorizontalLinesPercentage = \u0413\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u044B\u0435 \u043B\u0438\u043D\u0438\u0438 (\u043E\u0441\u044C \u043F\u0440\u043E\u0446\u0435\u043D\u0442\u043E\u0432)

LabelChartDetailSettingsShowDataLabel = \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043C\u0435\u0442\u043A\u0438 \u0434\u0430\u043D\u043D\u044B\u0445

LabelChartDetailSettingsShowLimits = \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u044F

LabelChartDetailSettingsShowMarkerLines = \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0441 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u043C\u0430\u0440\u043A\u0435\u0440\u043D\u044B\u0445 \u043B\u0438\u043D\u0438\u0439

LabelChartDetailSettingsShowMissingTradingDays = \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043D\u0435\u0434\u043E\u0441\u0442\u0430\u044E\u0449\u0438\u0435 \u0442\u043E\u0440\u0433\u043E\u0432\u044B\u0435 \u0434\u043D\u0438

LabelChartDetailSettingsShowPercentageAxis = \u041F\u0440\u043E\u0446\u0435\u043D\u0442\u043D\u0430\u044F \u043E\u0441\u044C (\u0432\u0442\u043E\u0440\u0438\u0447\u043D\u0430\u044F)

LabelChartShowLabels = \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043C\u0435\u0442\u043A\u0438

LabelChartType = \u0422\u0438\u043F \u0433\u0440\u0430\u0444\u0438\u043A\u0430
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1119,18 +1119,20 @@ LabelChartDetailMovingAverage_90days = 90 dn\u00ED
LabelChartDetailSettings = Nastavenia
LabelChartDetailSettingsShowDataLabel = Zobrazi\u0165 popisky d\u00E1t
LabelChartDetailSettingsShowHorizontalLinesMain = Vodorovn\u00E9 \u010Diary (hodnotov\u00E1 os)
LabelChartDetailSettingsShowHorizontalLinesPercentage = Vodorovn\u00E9 \u010Diary (percentu\u00E1lna os)
LabelChartDetailSettingsShowDataLabel = Zobrazi\u0165 popisky d\u00E1t
LabelChartDetailSettingsShowLimits = Zobrazi\u0165 limity
LabelChartDetailSettingsShowMarkerLines = Zobrazi\u0165 pomocou zna\u010Dkovac\u00EDch \u010Diar
LabelChartDetailSettingsShowMissingTradingDays = Zobrazi\u0165 ch\u00FDbaj\u00FAce obchodn\u00E9 dni
LabelChartDetailSettingsShowPercentageAxis = Percentu\u00E1lna os (sekund\u00E1rna)
LabelChartShowLabels = Zobrazi\u0165 popisky
LabelChartType = Typ grafu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1121,12 +1121,18 @@ LabelChartDetailSettings = \u8BBE\u7F6E

LabelChartDetailSettingsShowDataLabel = \u663E\u793A\u6570\u636E\u6807\u7B7E

LabelChartDetailSettingsShowHorizontalLinesMain = \u6C34\u5E73\u7EBF\uFF08\u4EF7\u503C\u8F74\uFF09

LabelChartDetailSettingsShowHorizontalLinesPercentage = \u6C34\u5E73\u7EBF(\u767E\u5206\u6BD4\u8F74)

LabelChartDetailSettingsShowLimits = \u663E\u793A\u9650\u4EF7

LabelChartDetailSettingsShowMarkerLines = \u663E\u793A\u6807\u8BB0\u7EBF

LabelChartDetailSettingsShowMissingTradingDays = \u663E\u793A\u7F3A\u5931\u4EA4\u6613\u65E5

LabelChartDetailSettingsShowPercentageAxis = \u767E\u5206\u6BD4\u8F74(\u4E8C\u7EA7)

LabelChartShowLabels = \u663E\u793A\u6807\u7B7E

LabelChartType = \u56FE\u8868\u7C7B\u578B
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ private enum ChartDetails
SHOW_DATA_LABELS(Messages.LabelChartDetailSettingsShowDataLabel), //
SHOW_MISSING_TRADING_DAYS(Messages.LabelChartDetailSettingsShowMissingTradingDays), //
SHOW_LIMITS(Messages.LabelChartDetailSettingsShowLimits), //
SHOW_PERCENTAGE_AXIS(Messages.LabelChartDetailSettingsShowPercentageAxis), //
SHOW_MAIN_HORIZONTAL_LINES(Messages.LabelChartDetailSettingsShowHorizontalLinesMain), //
SHOW_PERCENTAGE_HORIZONTAL_LINES(Messages.LabelChartDetailSettingsShowHorizontalLinesPercentage);

Expand Down Expand Up @@ -672,6 +673,7 @@ private void chartConfigAboutToShow(IMenuManager manager)
subMenuChartSettings.add(addMenuAction(ChartDetails.SHOW_DATA_LABELS));
subMenuChartSettings.add(addMenuAction(ChartDetails.SHOW_MISSING_TRADING_DAYS));
subMenuChartSettings.add(new Separator());
subMenuChartSettings.add(addMenuAction(ChartDetails.SHOW_PERCENTAGE_AXIS));
subMenuChartSettings.add(addMenuAction(ChartDetails.SHOW_MAIN_HORIZONTAL_LINES));
subMenuChartSettings.add(addMenuAction(ChartDetails.SHOW_PERCENTAGE_HORIZONTAL_LINES));
manager.add(subMenuChartScaling);
Expand Down Expand Up @@ -714,6 +716,12 @@ private Action addMenuAction(ChartDetails detail)
chartConfig.remove(ChartDetails.CLOSING);
chartConfig.remove(ChartDetails.SCALING_LOG);
break;
case SHOW_MAIN_HORIZONTAL_LINES:
chartConfig.remove(ChartDetails.SHOW_PERCENTAGE_HORIZONTAL_LINES);
break;
case SHOW_PERCENTAGE_HORIZONTAL_LINES:
chartConfig.remove(ChartDetails.SHOW_MAIN_HORIZONTAL_LINES);
break;
default:
break;
}
Expand Down Expand Up @@ -896,14 +904,20 @@ private void updateChart()
{
yAxis3rd.setRange(new Range(yAxis1st.getRange().lower / firstQuote - 1,
yAxis1st.getRange().upper / firstQuote - 1));
// hide percentage axis in logarithmic mode
yAxis3rd.getTick().setVisible(!chartConfig.contains(ChartDetails.SCALING_LOG));
}

yAxis1st.enableLogScale(chartConfig.contains(ChartDetails.SCALING_LOG));
yAxis2nd.enableLogScale(chartConfig.contains(ChartDetails.SCALING_LOG));

yAxis1st.getTick().setVisible(true);
// hide percentage axis in logarithmic mode
yAxis3rd.getTick().setVisible(chartConfig.contains(ChartDetails.SHOW_PERCENTAGE_AXIS)
&& !chartConfig.contains(ChartDetails.SCALING_LOG));

// ensure that at least one set of horizontal lines is shown
if (!chartConfig.contains(ChartDetails.SHOW_MAIN_HORIZONTAL_LINES)
&& !chartConfig.contains(ChartDetails.SHOW_PERCENTAGE_HORIZONTAL_LINES))
chartConfig.add(ChartDetails.SHOW_MAIN_HORIZONTAL_LINES);

if (chartConfig.contains(ChartDetails.SHOW_MAIN_HORIZONTAL_LINES) || !yAxis3rd.getTick().isVisible())
yAxis1st.getGrid().setStyle(LineStyle.DOT);
Expand Down Expand Up @@ -1082,8 +1096,7 @@ private void addSMAMarkerLines(ChartInterval chartInterval, String smaSeries, St
if (smaLines == null || smaLines.getValues() == null || smaLines.getDates() == null)
return;

@SuppressWarnings("nls")
String lineID = smaSeries + " (" + smaDaysWording + ")";
String lineID = smaSeries + " (" + smaDaysWording + ")"; //$NON-NLS-1$ //$NON-NLS-2$

ILineSeries lineSeriesSMA = (ILineSeries) chart.getSeriesSet().createSeries(SeriesType.LINE, lineID);
lineSeriesSMA.setXDateSeries(smaLines.getDates());
Expand All @@ -1104,8 +1117,7 @@ private void addEMAMarkerLines(ChartInterval chartInterval, String emaSeries, St
if (emaLines == null || emaLines.getValues() == null || emaLines.getDates() == null)
return;

@SuppressWarnings("nls")
String lineID = emaSeries + " (" + emaDaysWording + ")";
String lineID = emaSeries + " (" + emaDaysWording + ")"; //$NON-NLS-1$ //$NON-NLS-2$

ILineSeries lineSeriesEMA = (ILineSeries) chart.getSeriesSet().createSeries(SeriesType.LINE, lineID);
lineSeriesEMA.setXDateSeries(emaLines.getDates());
Expand Down

0 comments on commit b0f5b93

Please sign in to comment.