Page 1 of 1

Multiple legends support for boxplot charts

Posted: Fri May 05, 2017 3:02 pm
by 16679099
Hi team STEEMA,

We are currently using the STEEMA control in our window based application to plot boxplot charts. These charts are generally drawn for a certain X axis label, but no legends.

Does STEEMA charting control support multiple itemed legends for boxplot charts?
The supporting example to the above question is attached as PNG file.

Do let us know if STEEMA does support this requirement and if yes, then how to set it up in an MFC application.

If this is not supported, please register this as an URGENT enhancement request and let us know by when this feature would be available.

Thanks & Best Regards,
-SNPSUSER

Re: Multiple legends support for boxplot charts

Posted: Mon May 08, 2017 7:45 am
by yeray
Hello,

You can do something like this:

Code: Select all

  TChart1.Aspect.View3D = False
  
  Dim i As Integer
  For i = 0 To 3
    TChart1.AddSeries scBox
    TChart1.Series(i).FillSampleValues
    TChart1.Series(i).asBoxPlot.Position = i
    
    If i Mod 2 = 0 Then
      TChart1.Series(i).Color = vbBlue
    Else
      TChart1.Series(i).Color = vbRed
    End If
    
    If i > 1 Then
      TChart1.Series(i).ShowInLegend = False
    End If
    
    TChart1.Series(i).asBoxPlot.Pointer.Pen.Color = TChart1.Series(i).Color
    TChart1.Series(i).asBoxPlot.MedianPen.Color = TChart1.Series(i).Color
    TChart1.Series(i).asBoxPlot.WhiskerPen.Color = TChart1.Series(i).Color
  Next i
  
  TChart1.Series(0).Title = "STRDC_ARY_REVA"
  TChart1.Series(1).Title = "STRFC_LC"
boxes.png
boxes.png (12.21 KiB) Viewed 3573 times

Re: Multiple legends support for boxplot charts

Posted: Tue May 23, 2017 9:31 am
by 16679099
Hi Yeray,

Thanks for your comments.

The suggested code would not work as a solution for us, as this code adds 4 series points, and colors as per odd and even logic. Also, we need the chart control to support multi colored box plots within a single X item i.e. as same as how a bar chart supports the visualization of multiple bars within a single X item. Thus we need to support multiple box plots for a single X item.

Do let us know, when would support for such visualization in box plot charts be available.

If required, we can have a voice/telephonic call to discuss the requirement.

Please treat this as an urgent request from us.

-SNPSUSER.

Re: Multiple legends support for boxplot charts

Posted: Thu May 25, 2017 11:39 am
by 10050769
Hello,

I’m afraid your request isn’t possible. We have added that to TeeChart VCL Bugzilla tracker as a wish to consider its implementations in future versions. Here’s the link: http://bugs.teechart.net/show_bug.cgi?id=1873
Feel free to add your mail to the CC list to be automatically notified when an update arrives.

The only way to achieve your request is doing as Yeray’s told you above or use an alternative, adding horizontal custom axis for each Series, setting a start or end position value (percentage) for each horizontal custom axis because series are represented next each other. Also, you need set false the Horizontal custom axis to get the expected results. I have attached an .tee file because you can check how you need do.
BoxPlotSideStack.zip
(8.29 KiB) Downloaded 210 times
Hoping this helps you
Thanks in advance

Re: Multiple legends support for boxplot charts

Posted: Fri Aug 18, 2017 11:29 am
by Marc
Hello SNPSUSER,

The chart your describe is achievable. It needs a little setting up and the concept division between point and series should be blurred. Adapting Yeray's code from his example, you would need to set up an array of the axis labels you require and decide what point (series) relationships to make so that the Checkbox click on the Legend activates/deactivates all required series.

Code: Select all

Private Sub FillTest()
 
  Dim dd(4)
  dd(0) = 0.9
  dd(1) = 1.1
  dd(2) = 1.9
  dd(3) = 2.1
  
  axislabels(0) = "GH12A1_2L9_N05"
  axislabels(1) = "GH12A1_2L3_N05"
  
  TChart1.Axis.Bottom.Increment = 1
  TChart1.Axis.Bottom.GridPen.Visible = False
  TChart1.Axis.Bottom.Labels.Angle = 90
  
  TChart1.Axis.Bottom.SetMinMax 0.5, 2.5 'set to less and greater than required positions
 
  For i = 0 To 3
    TChart1.AddSeries scBox
    TChart1.Series(i).FillSampleValues
    TChart1.Series(i).asBoxPlot.Position = dd(i)
   
    If i Mod 2 = 0 Then
      TChart1.Series(i).Color = vbBlue
    Else
      TChart1.Series(i).Color = vbRed
    End If
   
    If i > 1 Then
      TChart1.Series(i).ShowInLegend = False
    End If
   
    TChart1.Series(i).asBoxPlot.Pointer.Pen.Color = TChart1.Series(i).Color
    TChart1.Series(i).asBoxPlot.MedianPen.Color = TChart1.Series(i).Color
    TChart1.Series(i).asBoxPlot.WhiskerPen.Color = TChart1.Series(i).Color
  Next i
 
  TChart1.Series(0).Title = "STRDC_ARY_REVA"
  TChart1.Series(1).Title = "STRFC_LC"
End Sub
That gives a Chart that looks like this:
boxplot.png
boxplot.png (10.04 KiB) Viewed 3275 times
Use the Series position value to shift x-axis positions as more Series-Points are added to each Axis location. It is not necessary to use an array to control it as in this example; it could be calculated generically.

I hope that may be of help.

Regards,
Marc Meumann