FSharp.Charting icon indicating copy to clipboard operation
FSharp.Charting copied to clipboard

Side effect when settting PropertyDefaults for Charting.Grid to Enabled = false

Open muehlhaus opened this issue 11 years ago • 2 comments

When setting the PropertyDefaults for Charting.Grid to Enabled = false, it will lead to Charting.TickMark Enabled set to false as well. An additional type check might do the trick: let internal applyDefaults (chartType:SeriesChartType, target:'a, targetParentType:Type option, targetType:Type, property:PropertyInfo) = .... (propDefault.ParentType |> Option.forall (fun parentType -> parentType = targetType)) && ....

PS: This is my first command at all. I hope it is properly stated...Plus many thanks for providing such a great library...

muehlhaus avatar Jun 07 '13 09:06 muehlhaus

Could you write an exact repro, i.e. what to add to the PropertyDefaults, and which chart?

It seems to me that this line should already stop any new defaults for Grid being applied to TickMarks.

(propDefault.ParentType |> Option.forall (fun parentType -> targetType.IsAssignableFrom(parentType) || targetType.IsSubclassOf(parentType)))

ghost avatar Jun 09 '13 14:06 ghost

If I add the following ChartStyleDefault for Charting.Grid to all chart types then the TickMarks also disappear..

let internal PropertyDefaults = 
            [ // Define type specific defaults
            { ChartStyleDefault.ChartType = None; ParentParentType=Some(typeof<Charting.Axis>); ParentType =        Some(typeof<Charting.Grid>); PropertyName="Enabled"; PropertyDefault=(box false) }

muehlhaus avatar Jun 09 '13 15:06 muehlhaus