Skip to content

Commit

Permalink
Add support for MultiOHLCSeries plot
Browse files Browse the repository at this point in the history
- Wasn't wired up at all
  • Loading branch information
mofojed committed Nov 2, 2023
1 parent 372be80 commit 337c7c5
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,26 @@ public OHLCDataSeriesInternal createSeries(String seriesName, final BaseTable t,
timeCol, openCol, highCol, lowCol, closeCol);
}

public String getTimeCol() {
return timeCol;
}

public String getOpenCol() {
return openCol;
}

public String getHighCol() {
return highCol;
}

public String getLowCol() {
return lowCol;
}

public String getCloseCol() {
return closeCol;
}

////////////////////////////// CODE BELOW HERE IS GENERATED -- DO NOT EDIT BY HAND //////////////////////////////
////////////////////////////// TO REGENERATE RUN GenerateMultiSeries //////////////////////////////
////////////////////////////// AND THEN RUN GenerateFigureImmutable //////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ public boolean getDrawYError() {
return drawYError;
}

public String getX() {
return x;
}

public String getXLow() {
return xLow;
}
Expand All @@ -127,10 +123,6 @@ public String getXHigh() {
return xHigh;
}

public String getY() {
return y;
}

public String getYLow() {
return yLow;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import io.deephaven.plot.datasets.multiseries.AbstractMultiSeries;
import io.deephaven.plot.datasets.multiseries.AbstractPartitionedTableHandleMultiSeries;
import io.deephaven.plot.datasets.multiseries.MultiCatSeries;
import io.deephaven.plot.datasets.multiseries.MultiOHLCSeries;
import io.deephaven.plot.datasets.multiseries.MultiXYErrorBarSeries;
import io.deephaven.plot.datasets.multiseries.MultiXYSeries;
import io.deephaven.plot.datasets.ohlc.OHLCDataSeriesArray;
Expand Down Expand Up @@ -543,6 +544,56 @@ private FigureDescriptor.ChartDescriptor translate(ChartImpl chart) {
yAxis));
}

clientSeries.setLineColor(stringMapWithDefault(mergeColors(
multiXYErrorBarSeries.lineColorSeriesNameTointMap(),
multiXYErrorBarSeries.lineColorSeriesNameToStringMap(),
multiXYErrorBarSeries.lineColorSeriesNameToPaintMap())));
clientSeries.setPointColor(stringMapWithDefault(mergeColors(
multiXYErrorBarSeries.pointColorSeriesNameTointMap(),
multiXYErrorBarSeries.pointColorSeriesNameToStringMap(),
multiXYErrorBarSeries.pointColorSeriesNameToPaintMap())));
clientSeries.setLinesVisible(
boolMapWithDefault(
multiXYErrorBarSeries.linesVisibleSeriesNameToBooleanMap()));
clientSeries.setPointsVisible(
boolMapWithDefault(
multiXYErrorBarSeries.pointsVisibleSeriesNameToBooleanMap()));
clientSeries.setGradientVisible(
boolMapWithDefault(
multiXYErrorBarSeries.gradientVisibleSeriesNameTobooleanMap()));
clientSeries.setPointLabelFormat(stringMapWithDefault(
multiXYErrorBarSeries.pointLabelFormatSeriesNameToStringMap()));
clientSeries.setXToolTipPattern(
stringMapWithDefault(
multiXYErrorBarSeries.xToolTipPatternSeriesNameToStringMap()));
clientSeries.setYToolTipPattern(
stringMapWithDefault(
multiXYErrorBarSeries.yToolTipPatternSeriesNameToStringMap()));
clientSeries.setPointLabel(stringMapWithDefault(
multiXYErrorBarSeries.pointColorSeriesNameToStringMap(),
Objects::toString));
clientSeries.setPointSize(doubleMapWithDefault(
multiXYErrorBarSeries.pointSizeSeriesNameToNumberMap(),
number -> number == null ? null : number.doubleValue()));

clientSeries.setPointShape(stringMapWithDefault(mergeShapes(
multiXYErrorBarSeries.pointShapeSeriesNameToStringMap(),
multiXYErrorBarSeries.pointShapeSeriesNameToShapeMap())));
} else if (partitionedTableMultiSeries instanceof MultiOHLCSeries) {
MultiOHLCSeries multiXYErrorBarSeries =
(MultiOHLCSeries) partitionedTableMultiSeries;

clientAxes.add(makePartitionedTableSourceDescriptor(
plotHandle, multiXYErrorBarSeries.getTimeCol(), SourceType.TIME, xAxis));
clientAxes.add(makePartitionedTableSourceDescriptor(
plotHandle, multiXYErrorBarSeries.getOpenCol(), SourceType.OPEN, yAxis));
clientAxes.add(makePartitionedTableSourceDescriptor(
plotHandle, multiXYErrorBarSeries.getCloseCol(), SourceType.CLOSE, yAxis));
clientAxes.add(makePartitionedTableSourceDescriptor(
plotHandle, multiXYErrorBarSeries.getHighCol(), SourceType.HIGH, yAxis));
clientAxes.add(makePartitionedTableSourceDescriptor(
plotHandle, multiXYErrorBarSeries.getLowCol(), SourceType.LOW, yAxis));

clientSeries.setLineColor(stringMapWithDefault(mergeColors(
multiXYErrorBarSeries.lineColorSeriesNameTointMap(),
multiXYErrorBarSeries.lineColorSeriesNameToStringMap(),
Expand Down

0 comments on commit 337c7c5

Please sign in to comment.