Is it possible to create charts with .NET Core

Viewed 12400

I need create line chart in visual studio in C#. I have a question, that is it possible to create charts with .NET Core in Windows Forms?

3 Answers

Yes, you can do it as I did this.

  1. Install into your WinForms core project Microsoft charts nuget
  2. Install into your WinForms core project other nuget
  3. Remark: Forms designer for charts in Winforms core projects will not work. But you can create a temporary Winforms .Net Framework project. Then create a chart by project form designer.
  4. Then copy chart code into your first WinForms core project.

That's all you need.

I do it by installing System.Windows.Forms.DataVisualization + System.Data.SqlClient

Don't use Forms designer for charts in Winforms core projects. Just create a new Winforms solution with .Net Framework (not core). Then create a chart in a new form by using designer you can adjust it as you want (colors, series...). Copy related chart code (from code behind cs) into your WinForms core project that's it.

Related