Hello,
only a portion of the red line, I want to draw the dashed line.(XAML or Code-Behind)ColumnChart2D.Series[0].DataPoints[0].Stroke = Brushes.Transparent;ColumnChart2D.Series[0].DataPoints[0].Fill = Brushes.Red;ColumnChart2D.Series[0].DataPoints[0].StrokeThickness = 2;Line color and thickness could be modified in code-behind.But,I can not change line type of the red line.Is good in any way.please help,post your good idea.
regards.
yung
hi.
Your explanation was very satisfiedI'll request this feature,and post.
thanks for replyYours gratefully.Yung
Hi Yung,
One option is to use style but it would be applied for all of the Lines in the grid.
<Grid.Resources>
<Style TargetType="Line">
<Setter Property="StrokeDashArray" Value="5"/>
</Style>
</Grid.Resources>
If you need to set this only for the first Line then you can try to get a reference for the Line that represents the first point in the visual tree and either set the style above or use the following code:
private void button1_Click(object sender, RoutedEventArgs e)
{
Line firstLine =
Utilities.GetDescendantFromType(xamChart1, typeof(Line), false) as Line;
DoubleCollection dashes = new DoubleCollection();
dashes.Add(5);
firstLine.StrokeDashArray = dashes;
}
Note that the lines are generated each time when the chart is refreshed so this might be not a good option.
In order to possibly get this feature into a future release, please submit a feature request here