Recent

Author Topic: Legend entry for Box-Whisker series  (Read 4548 times)

wp

  • Hero Member
  • *****
  • Posts: 13433
Legend entry for Box-Whisker series
« on: January 20, 2013, 11:47:56 pm »
A box-whisker series shows for the legend symbol only a black-bordered white box. If there are several box-whisker series in the same chart it is not possible to distinguish them from their legend icon. Would it be possible to paint the box at least using the BoxBrush and BoxPen of the series? Ideally the icon should be a mini box/whisker symbol using all corresponding pens and brushes.

Ask

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 687
Re: Legend entry for Box-Whisker series
« Reply #1 on: January 22, 2013, 01:08:06 pm »
Done in r39933

wp

  • Hero Member
  • *****
  • Posts: 13433
Re: Legend entry for Box-Whisker series
« Reply #2 on: January 23, 2013, 12:22:17 am »
Thank you, very nice. A few minor issues though (see attached modified version of your demo):
  • The box-whisker series title is not displayed in the legend.
  • The same happens with a TChartListbox linked to the chart.
  • If the series icon is used in a TChartImageList the right whisker bar seems to be cut off which looks a bit strange (maybe the drawing rect is too narrow by 1 pixel).
  • Not sure if this does look good, but maybe there should be an option to draw the icon vertically to match the box/whisker orientation in the chart.
« Last Edit: January 23, 2013, 12:40:06 am by wp »

Ask

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 687
Re: Legend entry for Box-Whisker series
« Reply #3 on: January 24, 2013, 06:12:33 am »
Quote
title is not displayed in the legend.
...the right whisker bar seems to be cut off
Should be fixed in r39944.

Quote
an option to draw the icon vertically
I did not think it would look good too.
I implemented that, but still have doubts about the look.
Please apply and test the attached patch
(set LegendDirection property, optionally set Chart.Legend.FixedItemHeight to about 40).
Do you think it is worth committing?

wp

  • Hero Member
  • *****
  • Posts: 13433
Re: Legend entry for Box-Whisker series
« Reply #4 on: January 25, 2013, 12:04:10 am »
Well I think it's not too bad. What makes it look strange is that the whiskers extend across the entire SymbolWidth of the legend. I guess it would look better if BoxWidth and WhiskerWidth in the symbol would have the same values, or at least the same ratio, as in the chart; the symbol should not be blown up across the full Symbolwidth.

When writing this I had the idea that there may be cases where the boxes should extend horizontally, not vertically, in the chart. I tested the AxisIndexX and AxisIndexY properties as with a bar series -- and saw that this feature is already there. Great work.

Ask

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 687
Re: Legend entry for Box-Whisker series
« Reply #5 on: January 25, 2013, 01:00:50 am »
Quote
I think it's not too bad
Ok, committed in r39960

Quote
s it would look better if BoxWidth and WhiskerWidth in the symbol would have the same values, or at least the same ratio, as in the chart
They already have the same ratio.

Quote
I tested the AxisIndexX and AxisIndexY properties as with a bar series -- and saw that this feature is already there.
Also note that setting LegendDirection = bwlAuto will synchronize item rotation with series rotation.

 

TinyPortal © 2005-2018