MeshWeaver.Charting 2.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package MeshWeaver.Charting --version 2.0.3
                    
NuGet\Install-Package MeshWeaver.Charting -Version 2.0.3
                    
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="MeshWeaver.Charting" Version="2.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MeshWeaver.Charting" Version="2.0.3" />
                    
Directory.Packages.props
<PackageReference Include="MeshWeaver.Charting" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MeshWeaver.Charting --version 2.0.3
                    
#r "nuget: MeshWeaver.Charting, 2.0.3"
                    
#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.
#addin nuget:?package=MeshWeaver.Charting&version=2.0.3
                    
Install MeshWeaver.Charting as a Cake Addin
#tool nuget:?package=MeshWeaver.Charting&version=2.0.3
                    
Install MeshWeaver.Charting as a Cake Tool

MeshWeaver.Charting

Overview

MeshWeaver.Charting provides the core chart model definitions and controls for the MeshWeaver ecosystem. This library defines the ChartControl class that inherits from UiControl<ChartControl> in the MeshWeaver.Layout project, allowing for consistent chart rendering across different UI implementations.

Features

  • ChartControl class for UI implementations
  • Chart model definitions for various chart types (Bar, Line, Pie, Doughnut, Radar, Polar, Bubble, Scatter, Area)
  • Fluent builders for easy chart creation
  • Data structure models for chart configuration
  • Integration with the MeshWeaver UI control system

Usage

Basic Chart Creation

// Create a simple bar chart with fluent API
var chartModel = ChartModel
    .Bar()
    .WithData(data1, data2)
    .WithLabels("One", "Two", "Three", "Four")
    .WithLegend("First Dataset", "Second Dataset");

// Create the chart control
var chartControl = new ChartControl(chartModel);

Advanced Chart Examples

Bar Chart with Styling
var chart = ChartModel
    .Bar()
    .WithData(data1, data2)
    .WithLabels(labels)
    .WithLegend("Dataset 1", "Dataset 2")
    .WithPalette(ColorSchemes.Default);
    
var chartControl = new ChartControl(chart)
    .WithClass("sales-chart")
    .WithStyle(style => style.Width("100%").Height("300px"));
Line Chart
var chart = ChartModel
    .Line()
    .WithData(data1, data2)
    .WithLabels(labels)
    .WithLegend("First Dataset", "Second Dataset");
    
var chartControl = new ChartControl(chart);
Time Series Chart
var chart = ChartModel
    .Line()
    .WithTimeData(dates, data1, data2)
    .WithLegend("First Series", "Second Series");

var chartControl = new ChartControl(chart);
Stacked Bar Chart
var chart = ChartModel
    .Bar()
    .WithData(data1, data2, data3)
    .WithLabels(labels)
    .WithLegend("First", "Second", "Third")
    .Stacked();

var chartControl = new ChartControl(chart);
Floating Bar Chart
var chart = ChartModel
    .FloatingBar()
    .WithDataRanges(x1, x2)
    .WithLabels(labels);

var chartControl = new ChartControl(chart);
Bubble Chart
var chart = ChartModel
    .Bubble()
    .WithDataPoints(x1, y, data1)
    .WithLabels(labels);

var chartControl = new ChartControl(chart);
Pie/Doughnut Chart
var chart = ChartModel
    .Pie()
    .WithData(data1)
    .WithLabels(labels);

// Or for a doughnut chart
var doughnutChart = ChartModel
    .Doughnut()
    .WithData(data1)
    .WithLabels(labels);

var chartControl = new ChartControl(chart);
Area Chart
var chart = ChartModel
    .Area()
    .WithData(data1, data2)
    .WithLabels(labels)
    .WithLegend("Dataset 1", "Dataset 2");

var chartControl = new ChartControl(chart);
Quick Chart Creation
// Quick chart creation with minimal configuration
var chart = ChartModel.QuickDraw(ChartType.Bar, data1);

var chartControl = new ChartControl(chart);

Chart Types

MeshWeaver.Charting supports a wide range of chart types:

  • Bar Charts (standard, stacked, horizontal, floating, waterfall)
  • Line Charts (standard, area, scatter)
  • Pie and Doughnut Charts
  • Radar and Polar Charts
  • Bubble Charts
  • Scatter Charts

Key Concepts

  • Chart control architecture
  • Fluent builders for easy chart creation
  • Chart model definitions
  • Chart type specifications
  • Data structure models

Integration with MeshWeaver

  • Extends the MeshWeaver.Layout UiControl system
  • Provides models that UI implementations can render
  • Works seamlessly with Blazor, React, or other UI technologies

UI Implementations

This library provides the model definitions and controls, but does not include any UI rendering capabilities. For UI rendering, use one of the following implementations:

See Also

Refer to the main MeshWeaver documentation for more information about the overall project.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on MeshWeaver.Charting:

Package Downloads
MeshWeaver.Blazor.ChartJs

Package Description

MeshWeaver.Charting.Pivot

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.0 161 21 days ago
2.0.3 465 a month ago
2.0.2 457 a month ago
2.0.1 107 a month ago
2.0.0 143 a month ago
2.0.0-preview3 94 2 months ago
2.0.0-Preview2 94 3 months ago
2.0.0-preview1 88 4 months ago
1.0.1 125 7 months ago
1.0.0 110 7 months ago