I am trying to use charts from the WPF Toolkit (with LineSeries) and I don't want a legend at all. I need this since I have 10 such charts each with data from a different source and I would like to draw one legend for all 10, to save screen real estate.
By default the legend appears the moment you add a second LineSeries. Is there any way to prevent it from even appearing?
Thanks,
sprite.
I tried Quarermeister's approach but his has a reference to a "datavis" assembly in the TargetType attribute that I didn't have.
I also had to add padding to the right side of the chart because without the legend, my x-axis interval labels were extending outside the chart area.
Much more sensible approach...
Worked better for me than setting values to 0... Cheers!
Attached Property for DRY, easy usage:
<charting:Chart helpers:ChartHelpers.IsLegendHidden="True" ...
There doesn't seem to be an especially clean way. One simple approach is to set the Legend's Width to zero using LegendStyle:
A more drastic approach is to replace the ControlTemplate with one that does not include a Legend:
Use following namespaces: