RazorKit.ChartJs
1.1.0
dotnet add package RazorKit.ChartJs --version 1.1.0
NuGet\Install-Package RazorKit.ChartJs -Version 1.1.0
<PackageReference Include="RazorKit.ChartJs" Version="1.1.0" />
<PackageVersion Include="RazorKit.ChartJs" Version="1.1.0" />
<PackageReference Include="RazorKit.ChartJs" />
paket add RazorKit.ChartJs --version 1.1.0
#r "nuget: RazorKit.ChartJs, 1.1.0"
#addin nuget:?package=RazorKit.ChartJs&version=1.1.0
#tool nuget:?package=RazorKit.ChartJs&version=1.1.0
Welcome to RazorKit
RazorKit is a collection of lightweight, fluent-style Razor HTML helpers that make it easy for developers to integrate popular JavaScript libraries into their ASP.NET applications. With RazorKit, you can quickly implement features from libraries like Chart.js and DataTables, without the hassle of writing complex JavaScript or HTML code manually.
Using DataTables
Install the RazorKit.DataTables package from nuget.
PM> Install-Package RazorKit.DataTables
Add related scripts and style links and implement. Reference:
@using RazorKit
@(Html.DataTable<Person>()
.Columns(c =>
{
c.Field(f => f.Id).Visible(false);
c.Field(f => f.Name).Title("Name");
})
.DataSource(ds => ds
.URL(Url.Action("GetDataResult"))
.Method("POST")
.Naming(Convention.CamelCase))
.ServerSide(true)
.Render())
using RazorKit.DataTables;
[HttpPost]
public JsonResult GetDataResult(DataRequest request)
{
var result = ctx.People.ToDataResult(request);
return Json(result);
}
Using ChartJs
Install the RazorKit.ChartJs package from nuget.
PM> Install-Package RazorKit.ChartJs
Add related scripts and implement. Reference:
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
@using RazorKit
@(Html.Chart("canvasId")
.Data(d => d
.Labels("January", "February", "March", "April", "May", "June", "July")
.Datasets(ds => ds
.Line()
.Label("Line Chart")
.Data(65, 59, 80, 81, 56, 55, 40)))
.Render())
Using SweetAlert2
Install the RazorKit.SweetAlert2 package from nuget.
PM> Install-Package RazorKit.SweetAlert2
Add related scripts and implement. Reference:
<button id="alertButton">Show Alert</button>
@using RazorKit
@{
var alert =
Html.Swal()
.Title("Good job!")
.Text("You clicked the button!")
.Icon(SwalIcon.Question)
.Footer("footer of the alert");
}
<script>
document.getElementById('alertButton').addEventListener('click', function () {
@alert.Fire()
});
</script>
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. 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 is compatible. 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 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp3.1 is compatible. |
.NET Framework | net471 is compatible. net472 is compatible. net48 is compatible. net481 is compatible. |
-
.NETCoreApp 3.1
- Microsoft.AspNetCore.Mvc (>= 2.1.3)
- Newtonsoft.Json (>= 13.0.1)
-
.NETFramework 4.7.1
- Microsoft.AspNet.Mvc (>= 5.3.0)
- Newtonsoft.Json (>= 13.0.1)
-
.NETFramework 4.7.2
- Microsoft.AspNet.Mvc (>= 5.3.0)
- Newtonsoft.Json (>= 13.0.1)
-
.NETFramework 4.8
- Microsoft.AspNet.Mvc (>= 5.3.0)
- Newtonsoft.Json (>= 13.0.1)
-
.NETFramework 4.8.1
- Microsoft.AspNet.Mvc (>= 5.3.0)
- Newtonsoft.Json (>= 13.0.1)
-
net6.0
- Microsoft.AspNetCore.Mvc (>= 2.1.3)
- Newtonsoft.Json (>= 13.0.1)
-
net7.0
- Microsoft.AspNetCore.Mvc (>= 2.1.3)
- Newtonsoft.Json (>= 13.0.1)
-
net8.0
- Microsoft.AspNetCore.Mvc (>= 2.1.3)
- Newtonsoft.Json (>= 13.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Allow arrays in background color