Multiple legends support for boxplot charts

TeeChart for ActiveX, COM and ASP
Post Reply
SNPSUSER
Newbie
Newbie
Posts: 12
Joined: Thu Sep 08, 2016 12:00 am

Multiple legends support for boxplot charts

Post by SNPSUSER » Fri May 05, 2017 3:02 pm

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
Attachments
Multi Legend Box plot.png
Multi Legend Box plot.png (44.45 KiB) Viewed 17904 times

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Multiple legends support for boxplot charts

Post by Yeray » Mon May 08, 2017 7:45 am

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 17887 times
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

SNPSUSER
Newbie
Newbie
Posts: 12
Joined: Thu Sep 08, 2016 12:00 am

Re: Multiple legends support for boxplot charts

Post by SNPSUSER » Tue May 23, 2017 9:31 am

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.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Multiple legends support for boxplot charts

Post by Sandra » Thu May 25, 2017 11:39 am

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 1288 times
Hoping this helps you
Thanks in advance
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Multiple legends support for boxplot charts

Post by Marc » Fri Aug 18, 2017 11:29 am

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 17589 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
Steema Support

Post Reply