haskell-chart icon indicating copy to clipboard operation
haskell-chart copied to clipboard

Feature request: Placing text in corners of chart

Open joehealy opened this issue 8 years ago • 1 comments

I'm wanting to recreate a chart like the one below (created with matplotlib): chart1-text

I can put the lines on without any trouble (and the dots/crosses), but haven't figured out how to add the text. I'm guessing I need to add an additional BackendProgram somehow or somewhere.

Is this possible, or are code changes needed?

Thanks

joehealy avatar Jul 05 '16 11:07 joehealy

Without code changes you have two alternatives:

  • You can plot items of type PlotAnnotation to position text in viewport coordinates. However, you'll want to fix the axis ranges, otherwise some trial and error will be required to get the text to appear where you want.
  • You can create Renderable containing the text you need using the label function, and then overlay these over the Renderable generated for the chart. I haven't done this, but it shouldn't be too difficult.

timbod7 avatar Jul 05 '16 23:07 timbod7