Hi Brad,
You may add a blank indicator chart, and then add a multi-stacked bar layer to the blank indicator chart to create a multi-bar chart with 4 colors in 2 bars. The positive and negative part can be specified similar to the "Positive Negative Bars" sample code.
For example, in Java/C#, it is like:
XYChart myIndicator = myFinanceChart.addIndicator(80);
BarLayer layer = myIndicator.addBarLayer(Chart.Stack);
// The SPY bar
layer.addDataGroup("SPY");
layer.addDataSet(new ArrayMath(SPYData).selectGEZ(null, Chart.NoValue).result(), color1, "+SPY");
layer.addDataSet(new ArrayMath(SPYData).selectLTZ(null, Chart.NoValue).result(), color2, "-SPY");
// Add GLD bar
layer.addDataGroup("GLD");
layer.addDataSet(new ArrayMath(GLDData).selectGEZ(null, Chart.NoValue).result(), color3, "+GLD");
layer.addDataSet(new ArrayMath(GLDData).selectLTZ(null, Chart.NoValue).result(), color4, "-GLD");
Hope this can help.
Regards
Peter Kwan |