GoogleCharts.NET.Wrapper 2.0.0

dotnet add package GoogleCharts.NET.Wrapper --version 2.0.0
NuGet\Install-Package GoogleCharts.NET.Wrapper -Version 2.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GoogleCharts.NET.Wrapper" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GoogleCharts.NET.Wrapper --version 2.0.0
#r "nuget: GoogleCharts.NET.Wrapper, 2.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install GoogleCharts.NET.Wrapper as a Cake Addin
#addin nuget:?package=GoogleCharts.NET.Wrapper&version=2.0.0

// Install GoogleCharts.NET.Wrapper as a Cake Tool
#tool nuget:?package=GoogleCharts.NET.Wrapper&version=2.0.0

GoogleCharts.NET.Wrapper 2.0.0

Available charts :

  • Timeline
  • Gantt
  • Columns

How to start :

1. Add scripts to head of index.html:

<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript" src="/_content/GoogleCharts.NET.Wrapper/js/GoogleChartsWrapper.js"></script>

2. Add imports to _Imports.razor file

@using GoogleCharts.NET.Wrapper
@using GoogleCharts.NET.Wrapper.DataModels
@using GoogleCharts.NET.Wrapper.DataModels.Timeline
@using GoogleCharts.NET.Wrapper.DataModels.Gantt
@using GoogleCharts.NET.Wrapper.DataModels.Column
@using GoogleCharts.NET.Wrapper.Components

How to use:

@if (@Gantt != null)
{
  <GoogleChart DataTable="@Gantt"></GoogleChart>
}

@code {
  public DataTable<DataTableGanttRow> Gantt { get; set; }
 
  protected override async Task OnInitializedAsync()
  {
    //create Instance of DataTable with provided ID
    Gantt = await DataTable<DataTableGanttRow>.CreateAsync(jsRuntime, "myid");
    //add specific options to current chart
	  await Gantt.AddOptions(new GanttOptions
		  {
			  Height = 300,
			  Gantt = new Gantt
			  {
				  TrackHeight = 50,
				  BarHeight = 48
			  }
		  }
		 );
    //add data to chart
	  Gantt.AddRow(new DataTableGanttRow
		  {
			  TaskId = "2014Spring",
			  TaskName = "Spring 2014",
			  Resource = "spring",
			  StartDate = new DateTime(2014, 2, 22),
			  EndDate = new DateTime(2014, 5, 20),
			  Duration = null,
			  PercentComplete = 100,
			  Dependencies = null
		  });
	  Gantt.AddRow(new DataTableGanttRow
		  {
			  TaskId = "2014Summer",
		  	TaskName = "Summer 2014",
		  	Resource = "summer",
				StartDate = new DateTime(2014, 5, 21),
				EndDate = new DateTime(2014, 8, 20),
				Duration = null,
				PercentComplete = 100,
				Dependencies = null
			});
		Gantt.AddRow(new DataTableGanttRow
			{
				TaskId = "2015Summer",
				TaskName = "Summer 2015",
				Resource = "summer",
				StartDate = new DateTime(2015, 5, 21),
				EndDate = new DateTime(2015, 8, 20),
				Duration = null,
				PercentComplete = 100,
				Dependencies = null
			});
		Gantt.AddRow(new DataTableGanttRow
			{
				TaskId = "2014Autumn",
				TaskName = "Autumn 2014",
				Resource = "autumn",
				StartDate = new DateTime(2014, 8, 21),
				EndDate = new DateTime(2014, 11, 20),
				Duration = null,
				PercentComplete = 100,
				Dependencies = null
			});
    //set call back function which will be called when you click on a chart
		await Gantt.SetCallbackFunctionName(DotNetObjectReference.Create(this), "ShowAlert", true);
    //draw the chart
		await Gantt.DrawChart();
	}

	[JSInvokable]
	public void ShowAlert()
	{
		Console.WriteLine("HOORAY");
	}
}

You can see more examples here

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.0 898 6/17/2022
1.0.7 1,038 6/28/2021

Breaking changes:
     1. Instance of DataTable now is created via DataTable.CreateAsync method.
     2. SetChartId is deleted. (id now must be provided to CreateAsync method)
     3. GanttChart, TimelineChart components are replaced with GoogleChart component.

     New features:
     1. .NET 6 compatible.
     2. Added Columns chart.
     3. Added GanttOptions, TimelineOptions and ColumnsOptions
     4. Now supports multiple charts of same type.