title: WPF DataVisualization Chart DataPointStyle Affects Legend Colors
body: <p>I am using the DataVisualization Charting control to display a Stacked Area Chart. I would like to style the data points which appear on the chart. However, when I create a Style and assign it to the DataPointStyle, the legend markers are no longer the same color as the data they represent. They appear as a single color. I do not even have any styles yet defined in the style.</p>
  
  <p>My code is</p>
  
  <pre><code>Dim stackedDataPointStyle As New Style(GetType(AreaDataPoint))
  
  Dim cas = New Charting.StackedAreaSeries
  cas.SeriesDefinitions.Add(New SeriesDefinition With {.DependentValuePath = "Hrs", .IndependentValuePath = "Weekday", .ItemsSource = _data.Values, .Title = job.ProjectName, .DataPointStyle = stackedDataPointStyle})
  
  Chart1.Series.Add(cas)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/kkIec.png" alt="Incorrect Legend Colors"></p>
  
  <p>If I remove the .DataPointStyle = stackedDataPointStyle, the legend markers are the correct corresponding colors to the chart areas.</p>
  
  <p>Any help someone could provide would be appreciated. </p>
  
  <p>UPDATE: I have also tried using the following, where the Style is redefined with each new series that is added.</p>
  
  <pre><code>Dim cas = New Charting.StackedAreaSeries
  
  For Each job In _data
      Dim stackedDataPointStyle As New Style(GetType(AreaDataPoint))
      cas.SeriesDefinitions.Add(New SeriesDefinition With {.DependentValuePath = "Hrs", .IndependentValuePath = "Weekday", .ItemsSource = _data.Values, .Title = job.ProjectName, .DataPointStyle = stackedDataPointStyle})
  Next
  
  Chart1.Series.Add(cas)
  </code></pre>
  
  <p>The results are still the same.</p>