2

I'm trying to make a chart with FSharpChart that has a scale break in it. I found an example for asp.net that I have tried to rewrite for F#. However, the resulting chart does not have any scale break but has normal y-axis. Here is my code:

#r @"libs\MSDN.FSharpChart.dll.0.60\lib\MSDN.FSharpChart.dll"
#r @"System.Windows.Forms.DataVisualization"

open MSDN.FSharp.Charting
open System.Windows.Forms.DataVisualization.Charting

let c = [2;4;40000;3] |> FSharpChart.Line

c.Area.AxisY.ScaleBreakStyle.Enabled <- true
c.Area.AxisY.ScaleBreakStyle.CollapsibleSpaceThreshold <- 25
c.Area.AxisY.ScaleBreakStyle.LineWidth <- 2
c.Area.AxisY.ScaleBreakStyle.StartFromZero <- StartFromZero.Auto
c.Area.AxisY.ScaleBreakStyle.Spacing <- 2.0

FSharpChart.Create c

Thanks for any help! This doesn't work if you run it from the command line - must be in fsi (so that it keeps running).

Tomas Petricek
  • 240,744
  • 19
  • 378
  • 553
Taylor Southwick
  • 1,456
  • 13
  • 14
  • 3
    when you say you cannot get it to work can you be more specific – John Palmer Feb 24 '12 at 22:20
  • @JohnPalmer Sorry, I meant that the chart does not have the scale break that it should. I edited the original post to reflect this clarification. – Taylor Southwick Feb 26 '12 at 01:34
  • I would guess this is because FSharpChart sets a number of properties that are incompatible with the ScaleBreak feature, as summed up in the Remarks section here: http://msdn.microsoft.com/en-us/library/dd455709.aspx – Dirk Feb 28 '12 at 08:13

0 Answers0