WpfToolkit
WpfToolkit copied to clipboard
Allow to not show Grid Lines on Charts
Hello,
I am using your Charts and I would like to have the possibility to be able to hide and show the Grid Lines of Charts. I was checking your code and when getting the Axes of a Chart, you are setting the axis.ShowGridLines = true (this is done on the protected override void GetAxes(DataPoint firstDataPoint) method)
Can you please add a ShowGridLines dependency Property to the DataPointSingleSeriesWithAxes class and use it on the GetAxes method of each Chart?
For instance:
On DataPointSingleSeriesWithAxes class:
///
/// <summary>
/// Identifies the ShowGridLines dependency property.
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "GridLines", Justification = "This is the expected capitalization.")]
[SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "GridLine", Justification = "This is the expected capitalization.")]
public static readonly DependencyProperty ShowGridLinesProperty =
DependencyProperty.Register(
"ShowGridLines",
typeof(bool),
typeof(DataPointSingleSeriesWithAxes),
new PropertyMetadata(true));
And on ColumnSeries.cs, BarSeries.cs, etc
protected override void GetAxes(DataPoint firstDataPoint) { ... if (axis != null) { axis.ShowGridLines = ShowGridLines; //Use the value of the Dependency Property } ... }
With that, we can do something like (To hide the Grid Lines): <chartingToolkit:ColumnSeries Grid.Row="0" Grid.Column="0" DependentValuePath="Value" IndependentValuePath="Key" ItemsSource="{Binding Data}" ShowGridLines="False"/>
您好,我现在正在忙,可能无法亲自回复您的邮件。我将以最快的速度,尽快给您回复。
if you create a pull req for this, i will merge