Click here to Skip to main content
15,887,903 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
1)The first image(New Trend Graph.png) shows the graph with straight lines. But I don't want the straight lines.
(2)The second image(Merged batch Parameterwise Trend.png) shows the expected resulted image using C# WPF visualization.

Even I am using the style looking like this. Inspite of using StrokeLineJoin Property , I am not getting the expected result.

     <Style x:Key="DashedPolyLine" TargetType="{x:Type Polyline}">
            <Setter Property="StrokeThickness" Value="2" />
            <Setter Property="StrokeDashCap" Value="Round"></Setter>
            <Setter Property="Stroke" Value="Red" />
            <Setter Property="StrokeDashArray" Value="0,1,0,1"/>
            <Setter Property="Visibility" Value="Visible"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="StrokeStartLineCap" Value="Round"/>
            <Setter Property="StrokeEndLineCap" Value="Round"/>
            <Setter Property="Opacity" Value="1"></Setter>
            <Setter Property="StrokeLineJoin" Value="Round"/>
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="true">
                    <Setter Property="StrokeThickness" Value="4" />
                </Trigger>
            </Style.Triggers>
        </Style>


What I have tried:

I displayed the whole XAML code for my application:
  

<Window x:Class="GraphTest.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:GraphTest"
        mc:Ignorable="d"
        Title="MainWindow"
        Height="550"
        Width="1011"
        xmlns:DVC="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
        >
    <window.resources>
       
            &lt;!--&lt;Setter Property="Background" Value="{Binding Path=BatchTime, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>-->
            &lt;!--Value="{DynamicResource line1}"-->
            &lt;Setter Property="Template" Value="{x:Null}"/>
       
       
            &lt;Setter Property="StrokeThickness" Value="2" />
            &lt;Setter Property="StrokeDashCap" Value="Round"></setter>
            &lt;Setter Property="Stroke" Value="Red" />
            &lt;Setter Property="StrokeDashArray" Value="0,1,0,1"/>
            &lt;Setter Property="Visibility" Value="Visible"/>
            &lt;Setter Property="VerticalAlignment" Value="Center"/>
            &lt;Setter Property="StrokeStartLineCap" Value="Round"/>
            &lt;Setter Property="StrokeEndLineCap" Value="Round"/>
            &lt;Setter Property="Opacity" Value="1"></setter>
            &lt;Setter Property="StrokeLineJoin" Value="Round"/>
            <Style.Triggers>
                &lt;Trigger Property="IsMouseOver" Value="true">
                    &lt;Setter Property="StrokeThickness" Value="4" />
                </trigger>
            </style.Triggers>
       
   
    <grid>
        <dvc:chart>
            <dvc:chart.axes>
                <DVC:LinearAxis x:Name="XAxis" Orientation="X" Title="Time" Margin="0,0,169,0" ShowGridLines="True">
                    <dvc:linearaxis.gridlinestyle>
                       
                            &lt;Setter Property="Stroke" Value="Black"/>
                            &lt;Setter Property="StrokeThickness" Value="1"/>
                            &lt;Setter Property="StrokeDashArray" Value="2,4"/>
                       
                   
               
                <DVC:LinearAxis x:Name="YAxis" Orientation="Y" Title="Temp" ShowGridLines="True">
                    <dvc:linearaxis.gridlinestyle>
                       
                            &lt;Setter Property="Stroke" Value="Black"/>
                            &lt;Setter Property="StrokeThickness" Value="1"/>
                            &lt;Setter Property="StrokeDashArray" Value="2,4"/>
                       
                   
               

           
            <dvc:chart.series>
                <DVC:LineSeries  x:Name="Series1"
                                 DependentValuePath="Value"
                                 DataPointStyle="{StaticResource InvisiblePointStyle}"
                                 IndependentValuePath="Key"
                                 PolylineStyle="{DynamicResource DashedPolyLine}"/>
           
       
   


Can anyone help me to find this?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900