Charting in WPF
The WPF Toolkit released in June 2009 comes with a data visualization assembly called System.Windows.Controls.DataVisualization.Toolkit.dll that hosts the charting functionality in WPF. This article demonstrates how to draw charts using the WPF Toolkit.
Adding WPF Toolkit Reference
Before you can use any charting related functionality in a WPF application, you must download the WPF Toolkit. After that, you need to add a reference to an
assembly.
To add a reference, right-click the References folder of your project in
Solution Explorer and select Add Reference. This action will open the Add
Reference dialog as you can in the following Figure 1. On this dialog, select
Browse option and browse the
System.Windows.Controls.DataVisualization.Toolkit.dll assembly from the folder where you installed the WPF Toolkit. This assembly resides in the Binaries folder.
Tip: If you do not want to download WPF Toolkit, you can download the attached
project and copy WPFToolkit.dll and
System.Windows.Controls.DataVisualization.Toolkit.dll assemblies from this project to the bin folder of your project and add a reference.
Figure 1
Once you add the reference, you will see the
System.Windows.Controls.DataVisualization.
Toolkit added to your References dialog as you see in Figure 2.
Figure 2
Now, the next step is to import the
System.Windows.Controls.DataVisualization.toolkit and the
System.Windows.Controls.DataVisualization.Charting namespaces to the page. Once
you type xmlns= in your page, you will see these namespaces in the Intellisense.
Select and add both of them to your page as you can see in Figure 3.
Figure 3
The final reference added to the page looks like following. As you can see here,
I added name of this reference to ToolkitRef.
- xmlns:DV=«clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit»
- xmlns:DVC=«clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit»
Now you will see DVC in your page and once you
select it, you will notice all Charting related elements added to the
Intellisense. To add a Chart control to your page, just select the Chart control
from the list. The list of charting related elements looks like Figure 4.
Figure 4
Creating a WPF Chart
The Chart element represents a WPF Chart control in XAML.
- <DVC:Chart></DVC:Chart>
The code snippet in Listing 1 creates a Chart and sets its width, height, and
background properties of the Chart control.
- <DVC:Chart Name=«MyChart»Width=«400» Height=«250»
- Background=«YellowGreen»>
- </DVC:Chart>
Listing 1
The output of Listing 1 looks like Figure 5.
Figure 5
Chart Types in WPF
The Series attribute of the Chart element is used to create a chart type. If you
see in Figure 6, you will notice BarSeries, ColumnSeries, LineSeries, PieSeries,
and ScatterSeries attributes and based on the attribute, the chart will be
created.
Figure 6
Bar Chart in WPF
The code snippet in Listing 2 creates a bar chart by setting Chart.Series to
BarSeries. As you see, the binding is occurred on Key and Value fields of a data
source.
- <DVC:ChartCanvas.TopDVC:ChartCanvas.Top=«80» Canvas.Left=«10» Name=«mcChart»
- Width=«400» Height=«250»
- Background=«LightSteelBlue»>
- <DVC:Chart.Series>
- <DVC:BarSeriesTitleDVC:BarSeriesTitle=«Experience»
- IndependentValueBinding=«{Binding Path=Key}»
- DependentValueBinding=«{Binding Path=Value}»>
- </DVC:BarSeries>
- </DVC:Chart.Series>
- </DVC:Chart>
Listing 2
The code snippet in Listing 3 creates a collection in KeyValuePair form and sets
the ItemsSource property of the chart series. Same data can be used for other
chart types.
- private void LoadBarChartData()
- {
- ((BarSeries)mcChart.Series[0]).ItemsSource =
- new KeyValuePair<string,int>[]{
- newKeyValuePair<string,int>(«Project Manager», 12),
- newKeyValuePair<string,int>(«CEO», 25),
- newKeyValuePair<string,int>(«Software Engg.», 5),
- newKeyValuePair<string,int>(«Team Leader», 6),
- newKeyValuePair<string,int>(«Project Leader», 10),
- newKeyValuePair<string,int>(«Developer», 4) };
- }
Listing 3
The output looks like Figure 7.
Figure 7
Column Chart in WPF
The code snippet in Listing 4 creates a column chart by setting Chart.Series to
ColumnSeries. As you may see, the binding is occurred on Key and Value fields of
a data source.
- <DVC:ChartCanvas.TopDVC:ChartCanvas.Top=«80» Canvas.Left=«10»Name=«mcChart»
- Width=«400» Height=«250»
- Background=«LightSteelBlue»>
- <DVC:Chart.Series>
- <DVC:ColumnSeriesTitleDVC:ColumnSeriesTitle=«Experience»
- IndependentValueBinding=«{Binding Path=Key}»
- DependentValueBinding=«{Binding Path=Value}»>
- </DVC:ColumnSeries>
- </DVC:Chart.Series>
- </DVC:Chart>
Listing 4
The code snippet in Listing 5 creates a collection in KeyValuePair form and sets
the ItemsSource property of the chart series. Same data can be used for other
chart types.
- private void LoadColumnChartData()
- {
- ((ColumnSeries)mcChart.Series[0]).ItemsSource =
- new KeyValuePair<string,int>[]{
- new KeyValuePair<string,int>(«Project Manager», 12),
- new KeyValuePair<string,int>(«CEO», 25),
- new KeyValuePair<string,int>(«Software Engg.», 5),
- new KeyValuePair<string,int>(«Team Leader», 6),
- new KeyValuePair<string,int>(«Project Leader», 10),
- new KeyValuePair<string,int>(«Developer», 4) };
- }
Listing 5
The output looks like Figure 8.
Figure 8
Pie Chart in WPF
The code snippet in Listing 6 creates a pie chart by setting Chart.Series to
BarSeries. As you may see, the binding is occurred on Key and Value fields of a
data source.
- <DVC:ChartCanvas.Top=«80» Canvas.Left=«10» Name=«mcChart»
- Width=«400» Height=«250»
- Background=«LightSteelBlue»>
- <DVC:Chart.Series>
- <DVC:PieSeriesTitle=«Experience»
- IndependentValueBinding=«{Binding Path=Key}»
- DependentValueBinding=«{Binding Path=Value}»>
- </DVC:PieSeries>
- </DVC:Chart.Series>
- </DVC:Chart>
Listing 6
The code snippet in Listing 7 creates a collection in KeyValuePair form and sets
the ItemsSource property of the chart series. Same data can be used for other
chart types.
- private void LoadPieChartData()
- {
- ((PieSeries)mcChart.Series[0]).ItemsSource =
- new KeyValuePair<string,int>[]{
- newKeyValuePair<string,int>(«Project Manager», 12),
- newKeyValuePair<string,int>(«CEO», 25),
- newKeyValuePair<string,int>(«Software Engg.», 5),
- newKeyValuePair<string,int>(«Team Leader», 6),
- newKeyValuePair<string,int>(«Project Leader», 10),
- newKeyValuePair<string,int>(«Developer», 4) };
- }
Listing 7
The output looks like Figure 9.
Figure 9
Line Chart in WPF
The code snippet in Listing 8 creates a line chart by setting Chart.Series to
LineSeries. As you may see, the binding is occurred on Key and Value fields of a
data source.
- <DVC:ChartCanvas.Top=«80» Canvas.Left=«10» Name=«mcChart»
- Width=«400» Height=«250»
- Background=«LightSteelBlue»>
- <DVC:Chart.Series>
- <DVC:LineSeriesTitle=» Monthly Count»
- IndependentValueBinding=«{Binding Path=Key}»
- DependentValueBinding=«{Binding Path=Value}»>
- </DVC:LineSeries>
- </DVC:Chart.Series>
- </DVC:Chart>
Listing 8
The code snippet in Listing 9 creates a collection in KeyValuePair form and sets
the ItemsSource property of the chart series. Same data can be used for other
chart types.
- private void LoadLineChartData()
- {
- ((LineSeries)mcChart.Series[0]).ItemsSource =
- new KeyValuePair<DateTime,int>[]{
- newKeyValuePair<DateTime,int>(DateTime.Now, 100),
- newKeyValuePair<DateTime,int>(DateTime.Now.AddMonths(1), 130),
- newKeyValuePair<DateTime,int>(DateTime.Now.AddMonths(2), 150),
- newKeyValuePair<DateTime,int>(DateTime.Now.AddMonths(3), 125),
- new KeyValuePair<DateTime,int>(DateTime.Now.AddMonths(4),155) };
- }
Listing 9
The output looks like Figure 10.
Figure 10
Scatter Chart in WPF
The code snippet in Listing 9 creates a scatter chart by setting Chart.Series to
ScatterSeries. As you may see, the binding is occurred on Key and Value fields
of a data source.
- <DVC:ChartCanvas.Top=«80» Canvas.Left=«10» Name=«mcChart»
- Width=«400» Height=«250»
- Background=«LightSteelBlue»>
- <DVC:Chart.Series>
- <DVC:ScatterSeriesTitle=«Dots»
- IndependentValueBinding=«{Binding Path=Key}»
- DependentValueBinding=«{Binding Path=Value}»>
- </DVC:ScatterSeries>
- </DVC:Chart.Series>
- </DVC:Chart>
Listing 9
The code snippet in Listing 10 creates a collection in KeyValuePair form and
sets the ItemsSource property of the chart series. Same data can be used for
other chart types.
- private void LoadScatterChartData()
- {
- ((ScatterSeries)mcChart.Series[0]).ItemsSource =
- new KeyValuePair<DateTime,int>[]{
- new KeyValuePair<DateTime,int>(DateTime.Now, 100),
- new KeyValuePair<DateTime,int>(DateTime.Now.AddMonths(1), 130),
- new KeyValuePair<DateTime,int>(DateTime.Now.AddMonths(2), 150),
- new KeyValuePair<DateTime,int>(DateTime.Now.AddMonths(3), 125)
- };
- }
Listing 10
The output looks like Figure 11.
Figure 11
Area Chart in WPF
The code snippet in Listing 11 creates an area chart by setting Chart.Series to
AreaSeries. As you may see, the binding is occurred on Key and Value fields of a
data source.
- <!— Area Chart in Code Behind —>
- <DVC:ChartCanvas.Top=«80» Canvas.Left=«10»Name=«mcChart»
- Width=«400» Height=«250»
- Background=«LightSteelBlue»
- Title=«Area Chart»
- LegendTitle=«Month Rating»>
- <DVC:Chart.Series>
- <DVC:AreaSeries
- Title=«Area Chart»
- IndependentValuePath=«Key»
- DependentValuePath=«Value»>
- </DVC:AreaSeries>
- </DVC:Chart.Series>
- </DVC:Chart>
Listing 11
The code snippet in Listing 12 creates a collection in KeyValuePair form and
sets the ItemsSource property of the chart series. Same data can be used for
other chart types.
- private void LoadAreaChartData()
- {
- ((AreaSeries)mcChart.Series[0]).ItemsSource =
- new KeyValuePair<string,int>[]{
- new KeyValuePair<string,int>(«Jan 2009», 100),
- new KeyValuePair<string,int>(«Apr 2009», 180),
- new KeyValuePair<string,int>(«July 2009», 110),
- new KeyValuePair<string,int>(«Oct 2009», 95),
- new KeyValuePair<string,int>(«Jan 2010», 40),
- new KeyValuePair<string,int>(«Apr 2010», 95)
- };
- }
Listing 12
The output looks like Figure 12.
Figure 12
Chart Axes
The Axes property of Chart is used to add x and y axis to the chart. The code
snippet in Listing 13 adds a linear axis to the chart with its orientation,
title, font and other properties.
- <DVC:Chart.Axes>
- <!— Add Horizontal and Vertical Axes—>
- <DVC:LinearAxis
- Orientation=«Y»
- Title=«New Hires»
- Interval=«40»
- Foreground=«Black»
- Background=«GreenYellow»
- FontFamily=«Georgia»
- FontSize=«14»
- FontWeight=«Bold»/>
- </DVC:Chart.Axes>
Listing 13
The new output looks like Figure 13 that shows a left side chart title and
formatting.
Figure 13
Generating an Area Chart from a Collection
Now we are going to generate a bar chart from a collection. I have a class Fruit
that looks like Listing 14. It has two members Name and Share.
- class Fruit
- {
- public string Name { get; set; }
- public Int16 Share { get;set; }
- }
Listing 14
Listing 15 is a Fruit collection class that adds some Fruit objects in the
constructor.
- class FruitCollection : System.Collections.ObjectModel.Collection<Fruit>
- {
- publicFruitCollection()
- {
- Add(new Fruit { Name = «Mango», Share = 10 });
- Add(new Fruit { Name = «Banana», Share = 36 });
- Add(new Fruit { Name = «Apple», Share = 24 });
- Add(new Fruit { Name = «Guava», Share = 4 });
- Add(new Fruit { Name = «Orange», Share = 12 });
- Add(new Fruit { Name = «Pear», Share = 10 });
- Add(new Fruit { Name = «Pineapple», Share = 4 });
- }
- }
Listing 15
Now in our XAML code, I create a resource called FruitCollection and bind it to
the AreaSeries using the ItemsSource property as listed in Listing 16.
- <Grid.Resources>
- <local:FruitCollectionx:Key=«FruitCollection» />
- </Grid.Resources>
Listing 16
XAML code for binding a FruitCollection with an AreaSeries is listed in Listing
17.
- <DVC:Chart.Series>
- <DVC:AreaSeriesTitle=«Fruits»
- ItemsSource=«{StaticResourceFruitCollection}»
- IndependentValueBinding=«{Binding Path=Name}»
- DependentValueBinding=«{Binding Path=Share}»>
- </DVC:AreaSeries>
- </DVC:Chart.Series>
Listing 17
Now simply build and run the project. New output looks like Figure 14.
Figure 14
Summary
This tutorial discusses how to the WPF Toolkit to create various charts
including a bar chart, column chart, pie chart, area chart, scatter chart and a
line chart.
System.Windows.Controls.DataVisualization.Toolkit.dll
About (AI)
Download (1 files)
Request (2)
Upload
What is System.Windows.Controls.DataVisualization.Toolkit.dll?
This file is a Dynamic Link Library (DLL), designed as a repository for code, data, and resources among various programs. These DLL files enhance the efficiency of software applications and the operating system by providing shared access to a common set of functions. This method of sharing allows applications to avoid embedding duplicate code, streamlining both development and execution.
The information above is a general description of this file. For a more detailed analysis of this .dll file, simply submit a request as a guest (No membership needed). DLLme + AI will research the file to provide more detailed information when available.
Fix .DLL Errors
An error message indicating a .dll file is missing or corrupted can lead to a program malfunction or failure to launch. To address these issues, follow these steps:
- Update and restart PC: Confirm your computer has the latest Windows, software, and driver updates. After updating, reboot and double-check for any remaining updates. This often installs the missing .dll file to its proper location.
- Reinstall the software: Attempt to resolve the problem by reinstalling the software that is displaying the error. This process often restores the required .dll file to its designated location.
- Download the .DLL file: If reinstalling the software does not resolve the issue, download the .dll file from a reputable source and install the file manually.
Download .DLL
Updated: Nov 30th, 2022
System.Windows.Controls.DataVisualization.Toolkit.dll
by Microsoft Corporation
for WPF Toolkit
System.Windows.Controls.DataVisualization.Toolkit
- Version
- 3.5.50211.1
- Language
- 0 (Unknown)
- SHA1
- bacf3faa4bfb89003f36ac25aa93f71a3ae11070
- MD5
- c9f8b68fe0c99e7a13b5d51ca5700f51
266.5KB
Request a different version
Enter a specific version (32/64-bit, etc.) or specific software. Requesting .DLL files could improve your odds of success and increase the speed in which the .dll file is found.
Total Requests: 2
Last Requested: Nov 30th, 2022
Request (10 months ago) | 2 Requests |
DLL Errors
-
This application has failed to start because System.Windows.Controls.DataVisualization.Toolkit.dll was not found.
Re-installing the application may fix this problem.
- System.Windows.Controls.DataVisualization.Toolkit.dll Not Found.
This file is a part of the Microsoft Windows system. It is one of the many hidden in the system files of a Windows computer.
Some programs may need System.Windows.Controls.DataVisualization.Toolkit.dll to run properly, so if this file is missing you may encounter issues when trying to launch applications or games. Often, you will get an error message that says “System.Windows.Controls.DataVisualization.Toolkit.dll missing” that tells you which specific file needs to be restored so that the application or game can continue functioning.
To resolve these issues caused by a missing System.Windows.Controls.DataVisualization.Toolkit.dll, read the suggestions below.
Author:
Microsoft Corporation
Process:
System.Windows.Controls.DataVisualization.Toolkit
Common path(s):
subfolder %PROGRAM_FILES%
Filesize(s):
278,872 bytes
How to fix System.Windows.Controls.DataVisualization.Toolkit.dll missing error?
If the System.Windows.Controls.DataVisualization.Toolkit.dll missing error appears on your PC, you can use the methods below. Some are automatic, which means you can start a process to let the system automatically restore the file. Others are manual, meaning you will have to manually download System.Windows.Controls.DataVisualization.Toolkit.dll and move it to the correct program installation folder. If you are not very experienced with digging through system files and would prefer not to, you can simply go straight to an automatic method.
Here our list of solutions to try:
- Method 1: Download System.Windows.Controls.DataVisualization.Toolkit.dll
- Method 2: Fix the missing System.Windows.Controls.DataVisualization.Toolkit.dll error automatically
- Method 3: Update drivers to restore missing .dll files
- Method 4: Scan your PC for malware
- Method 5: Use System File Checker (SFC)
- Method 6: Fix corrupted System.Windows.Controls.DataVisualization.Toolkit.dll file by performing System Restore
Method 1: Download System.Windows.Controls.DataVisualization.Toolkit.dll
This is the most straightforward approach, but it is fully manual and will require you to download the right DLL file and place it in the correct folder on your PC.
Look through the list of available versions of System.Windows.Controls.DataVisualization.Toolkit.dll then select the correct file and click “Download”. If you are unsure which one to download, read the section below or choose an automatic method.
How to choose the correct version of System.Windows.Controls.DataVisualization.Toolkit.dll?
When looking through the list of DLL files, pay attention to whether it’s a 64-, or 32-bit file, as well as the language it uses. For 64-bit programs, use 64-bit files if they are listed above.
It’s best to choose those DLL files whose language corresponds to the language of your program, if possible. It’s also recommended to choose the latest version to ensure up-to-date functionality.
As long as you get these two parameters right, you won’t have any issues downloading the right file.
Where to place the System.Windows.Controls.DataVisualization.Toolkit.dll file?
After you’ve downloaded the correct DLL file, place it inside the program installation folder. Alternatively, you can put the System.Windows.Controls.DataVisualization.Toolkit.dll file within the Windows system directory.
How to register System.Windows.Controls.DataVisualization.Toolkit.dll?
If placing the missing System.Windows.Controls.DataVisualization.Toolkit.dll file into the proper directory doesn’t seem to solve the problem, this means you need to register it. To do so, copy your DLL file to the C:\Windows\System32 folder, then open a command prompt with administrator privileges. There, type “regsvr32 System.Windows.Controls.DataVisualization.Toolkit.dll” and press Enter.
Method 2: Fix the missing System.Windows.Controls.DataVisualization.Toolkit.dll error automatically
Outbyte PC Repair allows you to automatically repair DLL errors, without you having to worry about choosing the right file or registering it. The utility will not only download the correct version of System.Windows.Controls.DataVisualization.Toolkit.dll for free and suggest the right directory to install it to but will also resolve other issues related to the System.Windows.Controls.DataVisualization.Toolkit.dll file.
- Download System.Windows.Controls.DataVisualization.Toolkit.dll
- Fix the missing System.Windows.Controls.DataVisualization.Toolkit.dll error automatically
- Update drivers to restore missing .dll files
Method 3: Update drivers to restore missing .dll files
Driver updates for the Windows operating system, as well as for network adapters, monitors, printers, etc., can be downloaded individually and installed from the Windows Update Center or by using specialized utilities.
Option 1 — Automatic Device Drivers Update
Outbyte Driver Updater automatically updates drivers on Windows. Routine manual driver updates are now a thing of the past. Just with a few clicks you can automatically search your system for outdated drivers and update all of them.
- Download the Outbyte Driver Updater
- Install the application
- Launch the app
- Driver Updater will scan your system for outdated and missing drivers
- Click Update to automatically update all drivers
Option 2 — Manually Update Device Drivers
Of course, you can also choose to update your drivers yourself one by one. First you will need to look through them to find the outdated ones, then search for the updates online. Here’s how to do that:
- Go to Taskbar’s search box and type Device Manager, then select Device Manager in the search results.
- Select a category to look at the devices’ names — right-click the one that needs to be updated.
- Choose Search automatically for updated driver software.
- Select Update Driver.
- Windows might not be able to find the new driver automatically. In this case, you can find the driver on the manufacturer’s website, where all the necessary instructions are available. Just make sure to find the official website so that you only download the trusted driver and not some malicious software.
Method 4: Scan your PC for malware to fix the System.Windows.Controls.DataVisualization.Toolkit.dll error
DLL errors may be caused by malware on your computer, which can intentionally corrupt these files in order to substitute them with its own malicious files. If you suspect that this is what’s causing errors on your system, you should scan your computer for malware and eliminate it as soon as possible.
Option 1 — Windows Defender
The new version of Windows 10 has a built-in application called «Windows Defender», which allows you to check your computer for viruses and remove malware. In order to use the Windows Defender offline scan, follow these steps:
- Press the Win key or click Start and click on the gear icon to open Settings. Alternatively press Win + I key combination.
- Select the Update and Security option and go to the Windows Defender section.
- At the bottom of the Defender settings there is a checkbox labeled «Windows Defender Offline scan». To start it, click «Scan Now». Note that you will have to save all unsaved data before restarting your PC.
After you click the “Scan Now” button, the computer will reboot and automatically start searching for viruses and malware. Upon completion of the scan, the computer will restart, and in the notifications, you will see a report on the completed scan.
Option 2 — Outbyte AVarmor
Outbyte products are some of the most popular and effective programs for dealing with malware and unwanted programs, and they will come in handy even if you have a high-quality third-party antivirus installed. This software is specifically designed to complement your antivirus, not replace it. In the new version of Outbyte, scans can be performed in real time and manually. To initiate a manual scan please follow the steps below:
- Launch Outbyte AVarmor and click the Scan Now button. Also, you can select the Scan option on the left side of the program’s window and click Full Scan. The system will begin scanning and you will be able to see the scan results.
- Select items that you want to quarantine and press the “Quarantine Selected” button. After they’ve been quarantined, you may be prompted to reboot the computer.
- After the program has been restarted, you can delete all quarantined objects by going to the appropriate section of the program. However, if you found that your system started to encounter errors after something was quarantined, you should restore the file instead.
Check your system performance to eliminate file conflicts and junk accumulation. Resolve registry and missing file errors.
Compatible with Windows 7, 8, 10, 11
Method 5: Fix the System.Windows.Controls.DataVisualization.Toolkit.dll missing error with System File Checker (SFC)
Many users are familiar with the sfc/scannow system file integrity check command, which automatically checks and fixes protected Windows system files. It is often one of the first things experienced Windows users do when they encounter errors.
To execute this command, you have to run Command Prompt as an administrator.
- Start the command line as an administrator in Windows by pressing the Win key on your keyboard and typing «Command Prompt» in the search field, then — right-click on the result and select “Run as administrator”. Alternatively, you can press the Win + X key combination which will open the menu where you can select Command Prompt (Admin).
- Type sfc /scannow while in Command Prompt and hit Enter. After entering the command, a system check will begin. It will take a while, so please be patient. Once the process is complete you will see this message: “Windows Resource Protection found corrupt files and successfully repaired them.” or “Windows Resource Protection found corrupt files but was unable to fix some of them”.
Keep in mind that System File Checker (SFC) cannot fix integrity errors for those system files that are currently being used by the operating system. To fix these files you have to run SFC command through the command prompt in the Windows recovery environment. You can get into Windows Recovery Environment from the login screen by clicking Shutdown, then holding down the Shift key while selecting Restart.
In Windows 10, you can press Win key, select Settings > Update & security > Recovery and under Advanced Startup, click Restart now. You can also boot from the installation disk or bootable USB flash drive with the Windows 10 distribution. On the installation screen select your preferred language and then select “System Restore”. After that, go to “Troubleshooting” > “Advanced Settings” > “Command Prompt”. Once in Command Prompt type the following command: sfc /scannow /offbootdir=C:\ /offwindir=C:\Windows, where C is the partition with the installed operating system and C:\Windows is the path to the Windows 10 folder.
This operation will take a while and it is important to wait until it is complete. When finished, close the command prompt and restart the computer as usual. You should find that the System.Windows.Controls.DataVisualization.Toolkit.dll missing error is gone.
Method 6: Fix the corrupted System.Windows.Controls.DataVisualization.Toolkit.dll file by performing a System Restore
System Restore is very useful if you want to fix System.Windows.Controls.DataVisualization.Toolkit.dll error, or almost any other error. Using the «System Restore» function, you can choose to restore Windows to a date when the System.Windows.Controls.DataVisualization.Toolkit.dll file was not damaged. Restoring Windows to an earlier date cancels changes that were made to system files since that date. Please follow the steps below to roll back Windows using System Restore and get rid of the System.Windows.Controls.DataVisualization.Toolkit.dll error.
- Press the Win + R keys combination to launch the Run dialog.
- Type sfc /scannow while in Command Prompt and hit Enter.
After entering the command, a system check will begin. It will take a while, so please be patient. Once the operation is complete you will see this message: “Windows Resource Protection found corrupt files and successfully repaired them.” or “Windows Resource Protection found corrupt files but was unable to fix some of them”.
- Type rstrui in the Run text box and click OK or hit Enter. This will open the system recovery utility.
- The “System Restore” window may include the “Choose a different restore point” option. If so, select this option and click Next. Check the “Show more restore points” checkbox to see a complete list of dates.
- Click the «Next» button and then click «Finish» to confirm your restore point. At this point, your computer will reboot normally and boot up with a restored version of Windows, and the System.Windows.Controls.DataVisualization.Toolkit.dll error should be resolved.
I’ve been going through previous posts here and also some tutorial videos. It seems like the toolbox option has the chart control option since 4.0 and doesn’t need any extra downloads.
But in my case, the tool box starts with Pointer, followed by some common WPF controls and then all the WPF controls such as button, canvas and so on. I don’t see the chart control.
Read up that I may be missing an assembly reference. The reference seemed to be:
System.Windows.Control.dataVisualization.toolkit.dll
When I look up the list, I don’t even have such a reference available to import. The closest I had was:
System.Web.DataVisualization
I imported it and it doesn’t work too.
Please advice what am I missing. I am looking for chart control to start off and do some simple chart works on my current application. Thank you.
asked Feb 20, 2014 at 19:52
1
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 -> Choose Items
- click Browse
- go to your project folder
- open \packages\WPFToolkit.DataVisualization.3.5.50211.1\lib\System.Windows.Controls.DataVisualization.Toolkit.dll
- press Ok
- it will be on ‘Common WPF controls’ section
Make sure to install mentioned package before using the Package Manager Console : http://docs.nuget.org/docs/start-here/using-the-package-manager-console
PM> Install-Package WPFToolkit.DataVisualization
answered Feb 20, 2014 at 23:18
aybeaybe
15.6k9 gold badges57 silver badges105 bronze badges
3
NuGet
.NET CLI
Paket CLIR
Direct Download
Install-Package System.Windows.Controls.DataVisualization.Toolkit
dotnet add package System.Windows.Controls.DataVisualization.Toolkit
paket add System.Windows.Controls.DataVisualization.Toolkit
System.Windows.Controls.DataVisualization.Toolkit Download (Unzip the "nupkg" after downloading)