Does WPF chart management exist by default or do I need to do an external download?

I look at previous posts here, as well as some tutorial videos. It seems that the toolbox option has a chart management option with 4.0 and does not need additional downloads.

But in my case, the toolbox starts with a pointer, then some common WPF controls follow, and then all WPF controls, such as button, canvas, etc. I do not see control over the chart.

Read that I might miss the assembly link. The link was:

System.Windows.Control.dataVisualization.toolkit.dll

When I look at the list, I don’t even have such a link available for import. The closest I had:

System.Web.DataVisualization

I imported it and it does not work either.

I ask for advice that I am missing. I am looking for a chart control to get started and do some simple charting work in my current application. Thanks.

+4
source share
1 answer

I think this is what you are looking for: http://www.nuget.org/packages/WPFToolkit.DataVisualization/

<Window x:Class="drawtextonbitmap.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:chartingToolkit="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <chartingToolkit:Chart />
    </Grid>
</Window>

If you want it to appear in the ToolBox:

  • right click ToolBox -> Select Items
  • Click Browse
  • go to the project folder
  • open \ packages \ WPFToolkit.DataVisualization.3.5.50211.1 \ lib \ System.Windows.Controls.DataVisualization.Toolkit.dll
  • click ok
  • it will be located in the "General WPF Controls" section.

: http://docs.nuget.org/docs/start-here/using-the-package-manager-console

PM> Install-Package WPFToolkit.DataVisualization
+3

Source: https://habr.com/ru/post/1527979/


All Articles