Hi Christian! And all,
I have a plot that consists of several CDLineLayers that is representing the “average” of some results. There is a similar plot with actual data points that includes scatter layers, and the legend of that one has line segments as the legend icon. The one with just linelayer has square symbols as legend icon. How can I use segments instead?
Thanks!
My plot code looks like the following, with one segment being the difference (plotting the actual data layers). I tried to add one scatterlayer outside the bounds of the plot but that didnt seem to set the legend:
[code]Dim c As New CDXYChartMBS(830, 440)
// Set the plotarea
Dim plotArea As CDPlotAreaMBS
plotArea = c.setPlotArea(60, 5, 585, 390)
//add legend
Dim legendArea As CDLegendBoxMBS
legendArea = c.addLegend(655, 150)
//set bg color
c.setBackground(&hf0f0f0) //bg xojo grey
plotArea.SetBackground(&hffffff) //plot area white
plotArea.setGridColor(&hd1d1d1,&hd1d1d1,-1,-1)
legendArea.setBackground(&hffffff)
// use a loop to plot the actual data layers. This step is all that is different between the two plot types.
call c.addScatterLayer(xPlotArray, yPlotArray, SourceArray(x),c.kDiamondSymbol, 9, colorArray(x), colorArray(x)) ', “”, c.kDiamondSymbol, 11, colorArray(x), -1 )
//mean
Dim layerMean As CDLineLayerMBS
layerMean = c.AddLineLayer(K_EQ_P0, color.Black, “Mean”)
layerMean.setXData(Z)
layerMean.setLineWidth(4)
If DrawPM1 = True AND K_EQ_M1(0) > 0 Then // some have 0 or inf values for any +/- sigma s
Dim layerP1 As CDLineLayerMBS
layerP1 = c.AddLineLayer(K_EQ_P1, color.Gray, “+1?”)
layerP1.setXData(Z)
layerP1.setLineWidth(2)
Dim layerM1 As CDLineLayerMBS
layerM1 = c.AddLineLayer(K_EQ_M1, color.Gray, “-1?”)
layerM1.setXData(Z)
layerM1.setLineWidth(2)
drawSum = drawSum + 2
End
…
xBlankPlot = Array(-100.00)
yBlankPlot = Array(-100.00)
//added to try and get plot to use segments
call c.addScatterLayer(xBlankPlot, yBlankPlot, “”, c.kDiamondSymbol, 9, color.Red, color.Red)
[/code]