Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

change point size in WPFToolkit

Tags:

c#

wpf

wpftoolkit

i try to change point size in wpf toolkit

<charting:Chart Name="Charts" Margin="87,48,0,0" Grid.Column="1">
        <charting:LineSeries Name="ChartOne" DependentValuePath="Y" IndependentValuePath="X" Title="График функции" AnimationSequence="FirstToLast"/>
        <charting:Chart.Axes>
            <charting:LinearAxis Orientation="Y" Title="Y" ShowGridLines="True" Minimum="0"/>
            <charting:LinearAxis Orientation="X" Title="X" ShowGridLines="True" Minimum="0"/>
        </charting:Chart.Axes>
        <charting:LineSeries.DataPointStyle>
            <Style TargetType="chartingToolkit:LineDataPoint">
                <Setter Property="Width" Value="20"/>
                <Setter Property="Height" Value="20"/>
            </Style>
        </charting:LineSeries.DataPointStyle>
    </charting:Chart>

but i have an error "The attachable property 'DataPointStyle' was not found in type 'LineSeries'" what am I doing wrong ?

like image 440
Konstantin Mokhov Avatar asked Nov 27 '25 05:11

Konstantin Mokhov


1 Answers

This code works for me

<Window x:Class="WpfApplication1.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:charting="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
    Title="MainWindow" Height="350" Width="525">
   <Grid>
    <charting:Chart Name="Charts" Margin="87,48,0,0" Grid.Column="1">

        <charting:Chart.Axes>
            <charting:LinearAxis Orientation="Y" Title="Y" ShowGridLines="True" Minimum="0"/>
            <charting:LinearAxis Orientation="X" Title="X" ShowGridLines="True" Minimum="0"/>
        </charting:Chart.Axes>
        <charting:LineSeries Name="ChartOne" DependentValuePath="Y" IndependentValuePath="X" 
                             Title="График функции" AnimationSequence="FirstToLast">
        <charting:LineSeries.DataPointStyle>
            <Style TargetType="{x:Type charting:LineDataPoint}">
                <Setter Property="Width" Value="20"/>
                <Setter Property="Height" Value="20"/>
            </Style>
        </charting:LineSeries.DataPointStyle>
        </charting:LineSeries>
   </charting:Chart>
</Grid>

like image 179
midhu458 Avatar answered Nov 28 '25 20:11

midhu458



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!