Giter Club home page Giter Club logo

bridge.chartjs's Introduction

Intro

This library helps you utilize Chart.js library in your Bridge.NET project in a type-safe way.

Installation

Copy and paste the contents of Generated.ChartJS.cs to your project and thats it!

Eample:

Include Chart.js in your html page

<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.min.js"></script>

Define a canvas

<div style="width: 500px; height: 400px;">
     <canvas id="chartCanvas"></canvas>
</div>
// App.cs
var canvas = Document.GetElementById("chartCanvas") as HTMLCanvasElement;
var radarChart = new Chart(canvas, new ChartConfig
{
    Type = ChartType.Radar,
    Data = new DataConfig
    {
        Labels = new [] { "Eating", "Drinking", "Sleeping", "Designing", "Coding", "Cycling", "Running" },
        Datasets = new Dataset[]
        {
            new RadarDataset
            {
                Label = "Today",
                Data = new int[] { 65, 59, 90, 81, 56, 55, 40 },
                PointRadius = 10,
                PointHoverRadius = 5,
                BackgroundColor = "rgba(0, 100, 255, 0.4)",
                PointHoverBackgroundColor = "blue",
            },
            new RadarDataset
            {
                Label = "Yesterday",
                Data = new int [] { 28, 48, 40, 19, 96, 27, 100 },
                PointRadius = 10,
                PointHoverRadius = 5,
                BackgroundColor = "rgba(0, 255, 100, 0.4)",
                PointHoverBackgroundColor = "green"
            }
        }
    }
});

Will generate

untitled

bridge.chartjs's People

Contributors

zaid-ajaj avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.