Menu

#51 Lines instead of colorboxes in legend

6.0.0
closed
lbayuk
None
3
Fixed
2013-04-03
2012-12-09
lbayuk
No

In this discussion thread an additional request is to show the line with proper color and line thickness in the legend, instead of a color-box. This would make the legend usable when the plot has many lines and uses both color and thickness to distinguish them.

Related

Bugs: #166
Discussion: Make Legend colorbox border optional
Wiki: 6.0.0-NEWS
Wiki: LegendLineMarkers

Discussion

  • lbayuk

    lbayuk - 2012-12-18
    • milestone: None --> 6.0.0
     
  • lbayuk

    lbayuk - 2012-12-18

    This will be implemented by extending the purpose of the SetLegendUseShapes() method. Currently this makes the legend use point shapes in the legend for points and linepoints plots, and does nothing for any other plot type. When this feature request is implemented, SetLegendUseShapes() will also apply to lines and squared plot types. (I was going to add thinbarline too, but that doesn't work with multiple data sets, so a legend is pointless there.) For those plot types, SetLegendUseShapes(TRUE) will replace the color boxes in the legend with short line segments of the same color and width as in the plot.

    Note: Initially, the implementation used a diagonal line in the legend as the marker. The linked wiki page [wiki:LegendLineMarkers] showed these, but has been fixed to show the horizontal line segments. In order to make these work, the color box width had to be increased by a factor of 4 when using line markers in the legend.

     

    Related

    Wiki: LegendLineMarkers


    Last edit: lbayuk 2012-12-18
  • lbayuk

    lbayuk - 2012-12-20

    Added line styles:

    Besides using the corresponding color and line width, the lines in the legend will also be drawn in the correct style (dashed or solid). But wide and dashed together do not work well, due to the way GD draws them.

     
  • lbayuk

    lbayuk - 2012-12-24
    • resolution: None --> Fixed
     
  • lbayuk

    lbayuk - 2012-12-24

    This has been implemented and committed to Subversion (on the Rel6 branch) and is planned for PHPlot-6.0.0. See above for details. Documentation has been updated, and new test scripts are committed.

     
  • lbayuk

    lbayuk - 2013-04-03
    • status: open --> closed
     
  • lbayuk

    lbayuk - 2013-04-03

    Implemented in 6.0.0

     

Log in to post a comment.