精华内容
下载资源
问答
  • Chart.MultiFloatingBar.js Chart.js 的多浮动栏插件 执照 Chart.MultiFloatingBar.js 在下可用。
  • Chart.MultiDoughnut.js Chart.js 的 MultiDoughnut 插件 文档 文档可以在/docs文件夹下找到。 有关如何使用 Chart.js 的文档,请参阅 Chart.js。 执照 Chart.MultiDoughnut.js 在下可用。
  • Chart.StackedArea.js Chart.js的StackedArea插件 文献资料 您可以在/docs下找到/docs 执照 Chart.StackedArea.js在下可用。
  • Chart.StackedLine.js 用于 Chart.js 的插件 灵感来自 文档 详细文档即将推出。 现在期望行为类似于 Chart(ctx).Line(data),除了它是 Chart(ctx)StackedLine(data)。 执照 Chart.StackedLine.js 在下可用。
  • Simple yet flexible JavaScript charting for designers &... For support, please post questions on Stack Overflow with the chartjs tag. License Chart.js is available under the MIT license.
  • Chart.js 包装 Chart.js-ObjC-Wrapper ,Chart.js-ObjC-Wrapper 可与 WKWebView/WebView 结合,将 Ch...
  • @ jhonnold / react-chart.js 流行的库的React组件 安装 npm install --save @jhonnold/react-chart.js chart.js chart.js是对等依赖项,必须与该库一起安装 入门 import { BarChart } from '@jhonnold/react-...
  • Chart.StackedArea.js Chart.js 的 StackedArea 插件 文档 您可以在/docs下找到/docs 执照 Chart.StackedArea.js 在下可用。 错误和问题 在报告错误或问题时,如果您可以包含一个指向简单的或类似问题的链接,那将...
  • Simple yet flexible JavaScript charting for designers &... For support, please post questions on Stack Overflow with the chartjs tag. License Chart.js is available under the MIT license.
  • chart.js:关于chart.js中图形的开发
  • chart.js模具 具有Chart.js Web组件(自定义元素)。
  • Chart.dc.jsChart.js的扩展,致力于将Crossfilter与Chart.js集成,并支持dc.js图表​​组。 出于对使用Chart.js中干净,简单且独特的图表实现的渴望,而又希望将它们与dc.js合并到d3js图表中的行为一样使用。 ...
  • 我正在学习... 面向设计人员和开发人员的简单而灵活JavaScript图表 文献资料 样本 贡献 可以在文档中找到有关构建和... 要获得支持,请使用chartjs标记在Stack Overflow上发布问题。 执照 Chart.js在MIT许可下可用。
  • Chart.LogarithmicLine.js Chart.js 的 LogarithmicLine 插件 用法 介绍 带有对数 y 轴的折线图是一种显示具有高值范围的数据的方式。 示例图像 示例用法 var myLogarithmicLineChart = new Chart ( ctx ) . ...
  • Chart.Clock.js - 约会列表的时钟视图 (v1.0.1) (C)2014 版权所有 Andy Mudrak,麻省理工学院许可证 Chart.Clock.jsChart.js 的扩展,提供了一个时钟图表,可以根据约会列表显示节/空闲时间,也可以显示当前...
  • vue chart.js 具有Chart.js的Vue图表组件 (Vue Chart Component with Chart.js) A reactive chart component for Vue.js application, powered by Chart.js library. This is a final working example from my ...

    vue chart.js

    具有Chart.js的Vue图表组件 (Vue Chart Component with Chart.js)

    A reactive chart component for Vue.js application, powered by Chart.js library. This is a final working example from my tutorial: Vue Chart Component with Chart.js.

    由Chart.js库提供支持的Vue.js应用程序的React式图表组件。 这是我的教程中的最后一个工作示例:带有Chart.js的Vue图表组件。

    要求 (Requirements)

    The following item is required to run this example:

    运行此示例需要以下各项:

    安装 (Installation)

    1.克隆存储库 (1. Clone the Repository)

    To clone this repository, run the following command on your terminal:

    要克隆此存储库,请在终端上运行以下命令:

    $ git clone[email protected]:risan/vue-chart-example.git
    

    2.安装依赖项 (2. Install the Dependencies)

    Within the project directory, run the following command to install all of the required dependencies:

    在项目目录中,运行以下命令以安装所有必需的依赖项:

    # Go to the project directory
    $ cd vue-chart-example
    
    # Install all of the dependencies
    $ npm install
    
    # Or if you prefer to use Yarn
    $ yarn install

    3.运行应用程序🎉 (3. Run the Application 🎉)

    To run the application, run the following command:

    要运行该应用程序,请运行以下命令:

    $ npm run serve
    
    # Or with yarn
    $ yarn serve
    The above command will start the development server. Open your browser and visit the application at [localhost:8080](http://localhost:8080).

    4.量产 (4. Build for Production)

    To build the application for production, run the following command:

    要生成用于生产的应用程序,请运行以下命令:

    $ npm run build
    
    # Or with yarn
    $ yarn build

    The optimized build files will be available at dist directory.

    优化的构建文件将在dist目录中提供。

    翻译自: https://vuejsexamples.com/vue-chart-component-example-with-chart-js/

    vue chart.js

    展开全文
  • vue chart.js Vue图表 (vue-chartjs) vue-chartjs is a wrapper for Chart.js in vue. You can easily create reuseable chart components. vue-chartjs是vue中Chart.js的包装。 您可以轻松创建可重复使用的图表...

    vue chart.js

    Vue图表 (vue-chartjs)

    vue-chartjs is a wrapper for Chart.js in vue. You can easily create reuseable chart components.

    vue-chartjs是vue中Chart.js的包装。 您可以轻松创建可重复使用的图表组件。

    Easy and beautiful charts with Chart.js and Vue.js

    通过Chart.js和Vue.js轻松漂亮的图表

    • Easy for both beginners and pros 🙌

      初学者和专业人士都容易

    • Simple to use, easy to extend 💪

      简单易用,易于扩展

    • With the full power of chart.js 💯

      充分利用chart.js full

    vue-chartjs

    现场演示 (live demo)

    http://demo.vue-chartjs.org/

    http://demo.vue-chartjs.org/

    文件 (Docs)

    http://vue-chartjs.org/#/

    http://vue-chartjs.org/#/

    翻译自: https://vuejsexamples.com/easy-and-beautiful-charts-with-chart-js-and-vue-js/

    vue chart.js

    展开全文
  • VUE-chartjs是一个包装在VUE。 您可以轻松创建可重复使用的图表组件。 演示和文档 :television: :open_book: 兼容性 v1之后@legacy Vue.js 1.x 以后的v2 Vue.js 2.x 在vue.js 2的最终发行版之后,如果通过npm...
  • 在您的页面中的 chart.js Chart.Core之后包含src/Chart.Gauge.js文件。 Gauge 图表类型现在将作为Chart.Gauge 用法 var gaugetData = [ { value : 50 , color : "#c50200" , label : "Getting there" } , { ...
  • 在这本有关使用Chart.js进行数据设计的课程的视频教程中,您将通过使用Chart.js框架在网格上绘制一系列点来创建简单的折线图。 完成此操作后,我们将观察Chart.js框架为您完成其余的繁重工作。 您可以在此处找到源...

    chart.js折线图

    在这本有关使用Chart.js进行数据设计的课程的视频教程中,您将通过使用Chart.js框架在网格上绘制一系列点来创建简单的折线图。 完成此操作后,我们将观察Chart.js框架为您完成其余的繁重工作。

    您可以在此处找到源代码:

    如何使用Chart.js创建折线图

    设置画布

    首先打开本教程的启动CodePen ,然后单击Fork按钮以创建它的新副本。 这将带我们到一个新的URL,在该URL中,我们拥有自己的新副本,并对其应用了相同的设置。

    当使用Chart.js框架创建图表时,我们将需要一个canvas元素。 Chart JS库依赖于canvas元素。 因此,在HTML部分中创建一个canvas元素,为其指定一个line-chart ID,然后关闭该canvas元素。

    <canvas id="line-chart"></canvas>

    我们不必担心该画布元素的样式或大小,因为即使我们尝试使用CSS或在HTML元素本身上使用属性来调整其大小,也无法正常工作。 Chart.js的工作方式只是将画布的大小调整为其父对象的大小,因此无论如何它仍将占据整个屏幕。 稍后,我们将研究如何解决该问题,但是现在,让我们进入JavaScript并创建图表本身。

    使用JavaScript创建上下文

    JavaScript中需要的第一件事是图表的上下文,这基本上只是一种表达我们要应用图表的元素的奇特方式,这就是我们的canvas对象。

    因此,我们将创建一个名为context的变量,简称ctx ,并将其设置为与该canvas对象相等。 我们将使用jQuery指向该画布对象。 因此,我将使用美元符号和括号,并在括号内使用一组引号,在引号内使用该画布对象CSS选择器。 我们要指向该对象的ID,因此我们将键入# ,然后输入ID(即line-chart ,然后在该语句的末尾添加一个分号。

    var ctx = $("#line-chart");

    添加JavaScript代码以绘制图表

    现在,我们已经完成了这一步,只需要再一行代码即可创建图表。 现在,它将是一个复杂的代码行,实际上最终将看起来像是多行代码,但这只是一条JavaScript语句。 这里是:

    现在,让我逐步引导您完成操作并解释发生的情况。

    我们首先创建一个名为lineChart的变量,然后使用Chart.js语法,将其设置为new Chart

    我们添加开括号和闭括号,在这些括号内,我们需要两件事:

    1. 我们将图表应用到的对象,或者我们创建并存储在名为ctx的变量中的ctx
    2. 包含该特定图表的所有数据和样式的对象。

    我们可以将第二个对象视为一组属性值对。 我们需要的第一个属性是指定这是什么类型的图表。 该属性名称为type 然后我们添加'line' ,这告诉Chart.js这是我们正在创建的折线图。

    然后,我们将输入逗号,然后转到下一行。 接下来,我们需要的是进入该图表的所有数据。 因此,我们将输入单词data 然后,此数据属性将成为一个对象。 因此,我们将使用大括号创建该对象,并且在该对象内部,我们将具有许多其他属性值对。

    在这个新对象中,我们需要做一些事情。

    我们需要的第一件事是所有要沿着图表底部移动的标签。 假设我们想要一个图表,该图表绘制出一年中某种产品的价格或一年中某只股票的股价。 因此,对于我们的标签,我们将每年的每个月都有一次。

    接下来我们需要的是一组数据集。 单个图表可以有多个数据集,但是现在我们只需要担心一个数据集。 因此,此属性的名称为datasets ,它将是一个对象数组。

    当我们使用方括号创建数组时,我们可以看到图表已经显示出来。

    我们在该图表上还没有任何数据,因此它不知道如何缩放图表左侧的所有数字,但是一旦我们开始插入一些值,它的外观就会改变。

    添加值时,您确实需要注意您在做什么。 我们需要确保我们的datasets元素以数组开头,并且在该数组内部有一个对象。

    在该对象内部,我们将首先获得2015的标签。 然后,我们在这里仅有的另一件事是值列表,该列表包含在另一个名为data属性中。 对于该示例,这些基本上只是12个随机数。

    观看Chart.js绘制图表

    一旦粘贴了这些数字,我们就会看到图表栩栩如生。

    所以现在我们看到,首先,我们的左轴已更改为与我们输入的数据匹配。 我们还可以看到在一年中的单个数据集,而我们为2015年添加的标签位于顶部。

    这就是使用Chart.js创建简单折线图的方式。

    观看完整课程

    数据设计(或“数据可视化”)是一种以易于使用和易于理解的方式显示信息的艺术。 在整个课程中,使用Chart.js进行数据设计 ,您将学习如何使用Chart.js动态显示具有交互式和引人注目的图表的数据。

    您将进一步使用此初始折线图,例如通过应用不同的样式并添加多个数据集。 然后,您将学习如何创建条形图,饼图甚至动画图。

    翻译自: https://webdesign.tutsplus.com/tutorials/how-to-create-a-simple-line-chart-with-chartjs--cms-28129

    chart.js折线图

    展开全文
  • Chart.js

    千次阅读 2017-01-30 17:53:48
    Chart.js Documentation Everything you need to know to build great looking chartsusing Chart.js Getting started Include Chart.js First we need to include the Chart.js library on the page. The libra

    Chart.js Documentation

    Everything you need to know to build great looking chartsusing Chart.js

    Getting started

    Include Chart.js

    First we need to include the Chart.js library on the page. The libraryoccupies a global variable of Chart.

    <script src="Chart.js"></script>

    Alternatively, if you're using an AMD loader for JavaScript modules, thatis also supported in the Chart.js core. Please note: the library will stilloccupy a global variable of Chart, even if it detects define and define.amd. If this is a problem, you can call noConflict to restore the global Chart variable to it's previousowner.

    // Using requirejs

    require(['path/to/Chartjs'], function(Chart){

        // UseChart.js as normal here.

     

        //Chart.noConflict restores the Chart global variable to it's previous owner

        // Thefunction returns what was previously Chart, allowing you to reassign.

        var Chartjs = Chart.noConflict();

     

    });

    You can also grab Chart.js using bower:

    bower install Chart.js --save

    Also, Chart.js is available from CDN:

    https://cdnjs.com/libraries/chart.js

    Creating a chart

    To create a chart, we need to instantiate the Chart class. To dothis, we need to pass in the 2d context of where we want to draw the chart.Here's an example.

    <canvas id="myChart" width="400" height="400"></canvas>

    // Get the context of the canvas element we want toselect

    var ctx = document.getElementById("myChart").getContext("2d");

    var myNewChart = new Chart(ctx).PolarArea(data);

    We can also get the context of our canvas with jQuery. To do this, we needto get the DOM node out of the jQuery collection, and call the getContext("2d") method on that.

    // Get context with jQuery - using jQuery's .get()method.

    var ctx = $("#myChart").get(0).getContext("2d");

    // This will get the first returned node in the jQuerycollection.

    var myNewChart = new Chart(ctx);

    After we've instantiated the Chart class on the canvas we want to draw on,Chart.js will handle the scaling for retina displays.

    With the Chart class set up, we can go on to create one of the chartsChart.js has available. In the example below, we would be drawing a Polar areachart.

    new Chart(ctx).PolarArea(data, options);

    We call a method of the name of the chart we want to create. We pass inthe data for that chart type, and the options for that chart as parameters.Chart.js will merge the global defaults with chart type specific defaults, thenmerge any options passed in as a second argument after data.

    Global chart configuration

    This concept was introduced in Chart.js 1.0 to keep configuration DRY, andallow for changing options globally across chart types, avoiding the need tospecify options for each instance, or the default for a particular chart type.

    Chart.defaults.global = {

        // Boolean- Whether to animate the chart

        animation: true,

     

        // Number -Number of animation steps

        animationSteps: 60,

     

        // String -Animation easing effect

        // Possibleeffects are:

        //[easeInOutQuart, linear, easeOutBounce, easeInBack, easeInOutQuad,

        //  easeOutQuart, easeOutQuad, easeInOutBounce,easeOutSine, easeInOutCubic,

        //  easeInExpo, easeInOutBack, easeInCirc,easeInOutElastic, easeOutBack,

        //  easeInQuad, easeInOutExpo, easeInQuart,easeOutQuint, easeInOutCirc,

        //  easeInSine, easeOutExpo, easeOutCirc,easeOutCubic, easeInQuint,

        //  easeInElastic, easeInOutSine, easeInOutQuint,easeInBounce,

        //  easeOutElastic, easeInCubic]

        animationEasing: "easeOutQuart",

     

        // Boolean- If we should show the scale at all

        showScale: true,

     

        // Boolean- If we want to override with a hard coded scale

        scaleOverride: false,

     

        // **Required if scaleOverride is true **

        // Number -The number of steps in a hard coded scale

        scaleSteps: null,

        // Number -The value jump in the hard coded scale

        scaleStepWidth: null,

        // Number -The scale starting value

        scaleStartValue: null,

     

        // String -Colour of the scale line

        scaleLineColor: "rgba(0,0,0,.1)",

     

        // Number -Pixel width of the scale line

        scaleLineWidth: 1,

     

        // Boolean- Whether to show labels on the scale

        scaleShowLabels: true,

     

        //Interpolated JS string - can access value

        scaleLabel: "<%=value%>",

     

        // Boolean- Whether the scale should stick to integers, not floats even if drawing spaceis there

        scaleIntegersOnly: true,

     

        // Boolean- Whether the scale should start at zero, or an order of magnitude down fromthe lowest value

        scaleBeginAtZero: false,

     

        // String -Scale label font declaration for the scale label

        scaleFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",

     

        // Number -Scale label font size in pixels

        scaleFontSize: 12,

     

        // String -Scale label font weight style

        scaleFontStyle: "normal",

     

        // String -Scale label font colour

        scaleFontColor: "#666",

     

        // Boolean- whether or not the chart should be responsive and resize when the browserdoes.

        responsive: false,

     

        // Boolean- whether to maintain the starting aspect ratio or not when responsive, if setto false, will take up entire container

        maintainAspectRatio: true,

     

        // Boolean- Determines whether to draw tooltips on the canvas or not

        showTooltips: true,

     

        // Function- Determines whether to execute the customTooltips function instead of drawingthe built in tooltips (See [Advanced - ExternalTooltips](#advanced-usage-custom-tooltips))

        customTooltips: false,

     

        // Array -Array of string names to attach tooltip events

        tooltipEvents: ["mousemove", "touchstart", "touchmove"],

     

        // String -Tooltip background colour

        tooltipFillColor: "rgba(0,0,0,0.8)",

     

        // String -Tooltip label font declaration for the scale label

        tooltipFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",

     

        // Number -Tooltip label font size in pixels

        tooltipFontSize: 14,

     

        // String -Tooltip font weight style

        tooltipFontStyle: "normal",

     

        // String -Tooltip label font colour

        tooltipFontColor: "#fff",

     

        // String -Tooltip title font declaration for the scale label

        tooltipTitleFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",

     

        // Number -Tooltip title font size in pixels

        tooltipTitleFontSize: 14,

     

        // String -Tooltip title font weight style

        tooltipTitleFontStyle: "bold",

     

        // String -Tooltip title font colour

        tooltipTitleFontColor: "#fff",

     

        // Number -pixel width of padding around tooltip text

        tooltipYPadding: 6,

     

        // Number -pixel width of padding around tooltip text

        tooltipXPadding: 6,

     

        // Number -Size of the caret on the tooltip

        tooltipCaretSize: 8,

     

        // Number -Pixel radius of the tooltip border

        tooltipCornerRadius: 6,

     

        // Number -Pixel offset from point x to tooltip edge

        tooltipXOffset: 10,

     

        // String -Template string for single tooltips

        tooltipTemplate: "<%if (label){%><%=label%>: <%}%><%= value%>",

     

        // String -Template string for multiple tooltips

        multiTooltipTemplate: "<%= value %>",

     

        // Function- Will fire on animation progression.

        onAnimationProgress: function(){},

     

        // Function- Will fire on animation completion.

        onAnimationComplete: function(){}

    }

    If for example, you wanted all charts created to be responsive, and resizewhen the browser window does, the following setting can be changed:

    Chart.defaults.global.responsive = true;

    Now, every time we create a chart, options.responsive will be true.

    Line Chart

    Introduction

    A line chart is a way of plotting data points on a line.

    Often, it is used to show trend data, and the comparison of two data sets.


    Example usage

    var myLineChart = new Chart(ctx).Line(data, options);

    Data structure

    var data = {

        labels: ["January", "February", "March", "April", "May", "June", "July"],

        datasets: [

            {

                label: "My First dataset",

                fillColor: "rgba(220,220,220,0.2)",

                strokeColor: "rgba(220,220,220,1)",

                pointColor: "rgba(220,220,220,1)",

                pointStrokeColor: "#fff",

                pointHighlightFill: "#fff",

                pointHighlightStroke: "rgba(220,220,220,1)",

                data: [65, 59, 80, 81, 56, 55, 40]

            },

            {

                label: "My Second dataset",

                fillColor: "rgba(151,187,205,0.2)",

                strokeColor: "rgba(151,187,205,1)",

                pointColor: "rgba(151,187,205,1)",

                pointStrokeColor: "#fff",

                pointHighlightFill: "#fff",

                pointHighlightStroke: "rgba(151,187,205,1)",

                data: [28, 48, 40, 19, 86, 27, 90]

            }

        ]

    };

    The line chart requires an array of labels for each of the data points.This is shown on the X axis. The data for line charts is broken up into anarray of datasets. Each dataset has a colour for the fill, a colour for theline and colours for the points and strokes of the points. These colours arestrings just like CSS. You can use RGBA, RGB, HEX or HSL notation.

    The label key on each dataset is optional, and can be used when generatinga scale for the chart.

    Chart options

    These are the customisation options specific to Line charts. These optionsare merged with the global chart configuration options, and form the options of the chart.

    {

     

        ///Boolean- Whether grid lines are shown across the chart

        scaleShowGridLines : true,

     

        //String -Colour of the grid lines

        scaleGridLineColor : "rgba(0,0,0,.05)",

     

        //Number -Width of the grid lines

        scaleGridLineWidth : 1,

     

        //Boolean -Whether to show horizontal lines (except X axis)

        scaleShowHorizontalLines: true,

     

        //Boolean -Whether to show vertical lines (except Y axis)

        scaleShowVerticalLines: true,

     

        //Boolean -Whether the line is curved between points

        bezierCurve : true,

     

        //Number -Tension of the bezier curve between points

        bezierCurveTension : 0.4,

     

        //Boolean -Whether to show a dot for each point

        pointDot : true,

     

        //Number -Radius of each point dot in pixels

        pointDotRadius : 4,

     

        //Number -Pixel width of point dot stroke

        pointDotStrokeWidth : 1,

     

        //Number -amount extra to add to the radius to cater for hit detection outside the drawnpoint

        pointHitDetectionRadius : 20,

     

        //Boolean -Whether to show a stroke for datasets

        datasetStroke : true,

     

        //Number -Pixel width of dataset stroke

        datasetStrokeWidth : 2,

     

        //Boolean -Whether to fill the dataset with a colour

        datasetFill : true,

     

        //String -A legend template

        legendTemplate : "<ul class=\"<%=name.toLowerCase()%>-legend\"><%for (var i=0; i<datasets.length; i++){%><li><spanstyle=\"background-color:<%=datasets[i].strokeColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>"

     

    };

    You can override these for your Chart instance bypassing a second argument into the Line method as anobject with the keys you want to override.

    For example, we could have a line chart without bezier curves betweenpoints by doing the following:

    new Chart(ctx).Line(data, {

        bezierCurve: false

    });

    // This will create a chart with all of the defaultoptions, merged from the global config,

    // and the Line chart defaults, but this particularinstance will have `bezierCurve` set to false.

    We can also change these defaults values for each Line type that iscreated, this object is available at Chart.defaults.Line.

    Prototype methods

    .getPointsAtEvent( event )

    Calling getPointsAtEvent(event) on your Chart instance passing an argument of an event,or jQuery event, will return the point elements that are at that the sameposition of that event.

    canvas.onclick = function(evt){

        var activePoints = myLineChart.getPointsAtEvent(evt);

        // =>activePoints is an array of points on the canvas that are at the same positionas the click event.

    };

    This functionality may be useful for implementing DOM based tooltips, ortriggering custom behaviour in your application.

    .update( )

    Calling update() on your Chart instance will re-render the chart with anyupdated values, allowing you to edit the value of multiple existing points,then render those in one animated render loop.

    myLineChart.datasets[0].points[2].value = 50;

    // Would update the first dataset's value of 'March' tobe 50

    myLineChart.update();

    // Calling update now animates the position of March from90 to 50.

    .addData( valuesArray, label )

    Calling addData(valuesArray,label) on your Chart instance passingan array of values for each dataset, along with a label for those points.

    // The values array passed into addData should be one foreach dataset in the chart

    myLineChart.addData([40, 60], "August");

    // This new data will now animate at the end of thechart.

    .removeData( )

    Calling removeData() on your Chart instance will remove the first value forall datasets on the chart.

    myLineChart.removeData();

    // The chart will remove the first point and animateother points into place

    Bar Chart

    Introduction

    A bar chart is a way of showing data as bars.

    It is sometimes used to show trend data, and the comparison of multipledata sets side by side.

    Example usage

    var myBarChart = new Chart(ctx).Bar(data, options);

    Data structure

    var data = {

        labels: ["January", "February", "March", "April", "May", "June", "July"],

        datasets: [

            {

                label: "My First dataset",

                fillColor: "rgba(220,220,220,0.5)",

                strokeColor: "rgba(220,220,220,0.8)",

                highlightFill: "rgba(220,220,220,0.75)",

                highlightStroke: "rgba(220,220,220,1)",

                data: [65, 59, 80, 81, 56, 55, 40]

            },

            {

                label: "My Second dataset",

                fillColor: "rgba(151,187,205,0.5)",

                strokeColor: "rgba(151,187,205,0.8)",

                highlightFill: "rgba(151,187,205,0.75)",

                highlightStroke: "rgba(151,187,205,1)",

                data: [28, 48, 40, 19, 86, 27, 90]

            }

        ]

    };

    The bar chart has the a very similar data structure to the line chart, andhas an array of datasets, each with colours and an array of data. Again,colours are in CSS format. We have an array of labels too for display. In theexample, we are showing the same data as the previous line chart example.

    The label key on each dataset is optional, and can be used when generatinga scale for the chart.

    Chart Options

    These are the customisation options specific to Bar charts. These optionsare merged with the global chart configuration options, and form the options of the chart.

    {

        //Boolean -Whether the scale should start at zero, or an order of magnitude down from thelowest value

        scaleBeginAtZero : true,

     

        //Boolean -Whether grid lines are shown across the chart

        scaleShowGridLines : true,

     

        //String -Colour of the grid lines

        scaleGridLineColor : "rgba(0,0,0,.05)",

     

        //Number -Width of the grid lines

        scaleGridLineWidth : 1,

     

        //Boolean -Whether to show horizontal lines (except X axis)

        scaleShowHorizontalLines: true,

     

        //Boolean -Whether to show vertical lines (except Y axis)

        scaleShowVerticalLines: true,

     

        //Boolean -If there is a stroke on each bar

        barShowStroke : true,

     

        //Number -Pixel width of the bar stroke

        barStrokeWidth : 2,

     

        //Number -Spacing between each of the X value sets

        barValueSpacing : 5,

     

        //Number -Spacing between data sets within X values

        barDatasetSpacing : 1,

     

        //String -A legend template

        legendTemplate : "<ulclass=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0;i<datasets.length; i++){%><li><spanstyle=\"background-color:<%=datasets[i].fillColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>"

     

    }

    You can override these for your Chart instance bypassing a second argument into the Bar method as anobject with the keys you want to override.

    For example, we could have a bar chart without a stroke on each bar bydoing the following:

    new Chart(ctx).Bar(data, {

        barShowStroke: false

    });

    // This will create a chart with all of the defaultoptions, merged from the global config,

    //  and the Barchart defaults but this particular instance will have `barShowStroke` set tofalse.

    We can also change these defaults values for each Bar type that iscreated, this object is available at Chart.defaults.Bar.

    Prototype methods

    .getBarsAtEvent( event )

    Calling getBarsAtEvent(event) on your Chart instance passing an argument of an event,or jQuery event, will return the bar elements that are at that the sameposition of that event.

    canvas.onclick = function(evt){

        var activeBars = myBarChart.getBarsAtEvent(evt);

        // =>activeBars is an array of bars on the canvas that are at the same position asthe click event.

    };

    This functionality may be useful for implementing DOM based tooltips, ortriggering custom behaviour in your application.

    .update( )

    Calling update() on your Chart instance will re-render the chart with anyupdated values, allowing you to edit the value of multiple existing points,then render those in one animated render loop.

    myBarChart.datasets[0].bars[2].value = 50;

    // Would update the first dataset's value of 'March' tobe 50

    myBarChart.update();

    // Calling update now animates the position of March from90 to 50.

    .addData( valuesArray, label )

    Calling addData(valuesArray,label) on your Chart instance passingan array of values for each dataset, along with a label for those bars.

    // The values array passed into addData should be one foreach dataset in the chart

    myBarChart.addData([40, 60], "August");

    // The new data will now animate at the end of the chart.

    .removeData( )

    Calling removeData() on your Chart instance will remove the first value forall datasets on the chart.

    myBarChart.removeData();

    // The chart will now animate and remove the first bar

    Radar Chart

    Introduction

    A radar chart is a way of showing multiple data points and the variationbetween them.

    They are often useful for comparing the points of two or more differentdata sets.


    Example usage

    var myRadarChart = new Chart(ctx).Radar(data, options);

    Data structure

    var data = {

        labels: ["Eating", "Drinking", "Sleeping", "Designing", "Coding", "Cycling", "Running"],

        datasets: [

            {

                label: "My First dataset",

                fillColor: "rgba(220,220,220,0.2)",

                strokeColor: "rgba(220,220,220,1)",

                pointColor: "rgba(220,220,220,1)",

                pointStrokeColor: "#fff",

                pointHighlightFill: "#fff",

                pointHighlightStroke: "rgba(220,220,220,1)",

                data: [65, 59, 90, 81, 56, 55, 40]

            },

            {

                label: "My Second dataset",

                fillColor: "rgba(151,187,205,0.2)",

                strokeColor: "rgba(151,187,205,1)",

                pointColor: "rgba(151,187,205,1)",

                pointStrokeColor: "#fff",

                pointHighlightFill: "#fff",

                pointHighlightStroke: "rgba(151,187,205,1)",

                data: [28, 48, 40, 19, 96, 27, 100]

            }

        ]

    };

    For a radar chart, to provide context of what each point means, we includean array of strings that show around each point in the chart. For the radarchart data, we have an array of datasets. Each of these is an object, with afill colour, a stroke colour, a colour for the fill of each point, and a colourfor the stroke of each point. We also have an array of data values.

    The label key on each dataset is optional, and can be used when generatinga scale for the chart.

    Chart options

    These are the customisation options specific to Radar charts. Theseoptions are merged with the global chart configuration options, and form the options of the chart.

    {

        //Boolean -Whether to show lines for each scale point

        scaleShowLine : true,

     

        //Boolean -Whether we show the angle lines out of the radar

        angleShowLineOut : true,

     

        //Boolean -Whether to show labels on the scale

        scaleShowLabels : false,

     

        // Boolean- Whether the scale should begin at zero

        scaleBeginAtZero : true,

     

        //String -Colour of the angle line

        angleLineColor : "rgba(0,0,0,.1)",

     

        //Number -Pixel width of the angle line

        angleLineWidth : 1,

     

        //String -Point label font declaration

        pointLabelFontFamily : "'Arial'",

     

        //String -Point label font weight

        pointLabelFontStyle : "normal",

     

        //Number -Point label font size in pixels

        pointLabelFontSize : 10,

     

        //String -Point label font colour

        pointLabelFontColor : "#666",

     

        //Boolean -Whether to show a dot for each point

        pointDot : true,

     

        //Number -Radius of each point dot in pixels

        pointDotRadius : 3,

     

        //Number -Pixel width of point dot stroke

        pointDotStrokeWidth : 1,

     

        //Number -amount extra to add to the radius to cater for hit detection outside the drawnpoint

        pointHitDetectionRadius : 20,

     

        //Boolean -Whether to show a stroke for datasets

        datasetStroke : true,

     

        //Number -Pixel width of dataset stroke

        datasetStrokeWidth : 2,

     

        //Boolean -Whether to fill the dataset with a colour

        datasetFill : true,

     

        //String -A legend template

        legendTemplate : "<ulclass=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0;i<datasets.length; i++){%><li><spanstyle=\"background-color:<%=datasets[i].strokeColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>"

     

    }

    You can override these for your Chart instance bypassing a second argument into the Radar method as an objectwith the keys you want to override.

    For example, we could have a radar chart without a point for each on pieceof data by doing the following:

    new Chart(ctx).Radar(data, {

        pointDot: false

    });

    // This will create a chart with all of the defaultoptions, merged from the global config,

    //  and the Barchart defaults but this particular instance will have `pointDot` set to false.

    We can also change these defaults values for each Radar type that is created,this object is available at Chart.defaults.Radar.

    Prototype methods

    .getPointsAtEvent( event )

    Calling getPointsAtEvent(event) on your Chart instance passing an argument of an event,or jQuery event, will return the point elements that are at that the sameposition of that event.

    canvas.onclick = function(evt){

        var activePoints = myRadarChart.getPointsAtEvent(evt);

        // =>activePoints is an array of points on the canvas that are at the same positionas the click event.

    };

    This functionality may be useful for implementing DOM based tooltips, ortriggering custom behaviour in your application.

    .update( )

    Calling update() on your Chart instance will re-render the chart with anyupdated values, allowing you to edit the value of multiple existing points,then render those in one animated render loop.

    myRadarChart.datasets[0].points[2].value = 50;

    // Would update the first dataset's value of 'Sleeping'to be 50

    myRadarChart.update();

    // Calling update now animates the position of Sleepingfrom 90 to 50.

    .addData( valuesArray, label )

    Calling addData(valuesArray,label) on your Chart instance passingan array of values for each dataset, along with a label for those points.

    // The values array passed into addData should be one foreach dataset in the chart

    myRadarChart.addData([40, 60], "Dancing");

    // The new data will now animate at the end of the chart.

    .removeData( )

    Calling removeData() on your Chart instance will remove the first value forall datasets on the chart.

    myRadarChart.removeData();

    // Other points will now animate to their correctpositions.

    Polar Area Chart

    Introduction

    Polar area charts are similar to pie charts, but each segment has the sameangle - the radius of the segment differs depending on the value.

    This type of chart is often useful when we want to show a comparison datasimilar to a pie chart, but also show a scale of values for context.

    Example usage

    new Chart(ctx).PolarArea(data, options);

    Data structure

    var data = [

        {

            value: 300,

            color:"#F7464A",

            highlight: "#FF5A5E",

            label: "Red"

        },

        {

            value: 50,

            color: "#46BFBD",

            highlight: "#5AD3D1",

            label: "Green"

        },

        {

            value: 100,

            color: "#FDB45C",

            highlight: "#FFC870",

            label: "Yellow"

        },

        {

            value: 40,

            color: "#949FB1",

            highlight: "#A8B3C5",

            label: "Grey"

        },

        {

            value: 120,

            color: "#4D5360",

            highlight: "#616774",

            label: "Dark Grey"

        }

     

    ];

    As you can see, for the chart data you pass in an array of objects, with avalue and a colour. The value attribute should be a number, while the colorattribute should be a string. Similar to CSS, for this string you can use HEXnotation, RGB, RGBA or HSL.

    Chart options

    These are the customisation options specific to Polar Area charts. Theseoptions are merged with the global chart configuration options, and form the options of the chart.

    {

        //Boolean -Show a backdrop to the scale label

        scaleShowLabelBackdrop : true,

     

        //String -The colour of the label backdrop

        scaleBackdropColor : "rgba(255,255,255,0.75)",

     

        // Boolean- Whether the scale should begin at zero

        scaleBeginAtZero : true,

     

        //Number -The backdrop padding above & below the label in pixels

        scaleBackdropPaddingY : 2,

     

        //Number -The backdrop padding to the side of the label in pixels

        scaleBackdropPaddingX : 2,

     

        //Boolean -Show line for each value in the scale

        scaleShowLine : true,

     

        //Boolean -Stroke a line around each segment in the chart

        segmentShowStroke : true,

     

        //String -The colour of the stroke on each segement.

        segmentStrokeColor : "#fff",

     

        //Number -The width of the stroke value in pixels

        segmentStrokeWidth : 2,

     

        //Number -Amount of animation steps

        animationSteps : 100,

     

        //String -Animation easing effect.

        animationEasing : "easeOutBounce",

     

        //Boolean -Whether to animate the rotation of the chart

        animateRotate : true,

     

        //Boolean -Whether to animate scaling the chart from the centre

        animateScale : false,

     

        //String -A legend template

        legendTemplate : "<ulclass=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0;i<segments.length; i++){%><li><spanstyle=\"background-color:<%=segments[i].fillColor%>\"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>"

     

    }

    You can override these for your Chart instance bypassing a second argument into the PolarArea method as anobject with the keys you want to override.

    For example, we could have a polar area chart with a black stroke on each segmentlike so:

    new Chart(ctx).PolarArea(data, {

        segmentStrokeColor: "#000000"

    });

    // This will create a chart with all of the defaultoptions, merged from the global config,

    // and the PolarArea chart defaults but this particularinstance will have `segmentStrokeColor` set to `"#000000"`.

    We can also change these defaults values for each PolarArea type that iscreated, this object is available at Chart.defaults.PolarArea.

    Prototype methods

    .getSegmentsAtEvent( event )

    Calling getSegmentsAtEvent(event) on your Chart instance passing an argument of an event,or jQuery event, will return the segment elements that are at that the sameposition of that event.

    canvas.onclick = function(evt){

        var activePoints = myPolarAreaChart.getSegmentsAtEvent(evt);

        // =>activePoints is an array of segments on the canvas that are at the sameposition as the click event.

    };

    This functionality may be useful for implementing DOM based tooltips, ortriggering custom behaviour in your application.

    .update( )

    Calling update() on your Chart instance will re-render the chart with anyupdated values, allowing you to edit the value of multiple existing points,then render those in one animated render loop.

    myPolarAreaChart.segments[1].value = 10;

    // Would update the first dataset's value of 'Green' tobe 10

    myPolarAreaChart.update();

    // Calling update now animates the position of Green from50 to 10.

    .addData( segmentData, index )

    Calling addData(segmentData,index) on your Chart instance passingan object in the same format as in the constructor. There is an option secondargument of 'index', this determines at what index the new segment should beinserted into the chart.

    // An object in the same format as the original datasource

    myPolarAreaChart.addData({

        value: 130,

        color: "#B48EAD",

        highlight: "#C69CBE",

        label: "Purple"

    });

    // The new segment will now animate in.

    .removeData( index )

    Calling removeData(index) on your Chart instance will remove segment at thatparticular index. If none is provided, it will default to the last segment.

    myPolarAreaChart.removeData();

    // Other segments will update to fill the empty spaceleft.

    Pie & Doughnut Charts

    Introduction

    Pie and doughnut charts are probably the most commonly used chart thereare. They are divided into segments, the arc of each segment shows theproportional value of each piece of data.

    They are excellent at showing the relational proportions between data.

    Pie and doughnut charts are effectively the same class in Chart.js, buthave one different default value - their percentageInnerCutout. This equates what percentage of the inner should be cut out. Thisdefaults to 0 for pie charts, and 50 for doughnuts.

    They are also registered under two aliases in the Chart core. Other thantheir different default value, and different alias, they are exactly the same.

    Example usage

    // For a pie chart

    var myPieChart = new Chart(ctx[0]).Pie(data,options);

     

    // And for a doughnut chart

    var myDoughnutChart = new Chart(ctx[1]).Doughnut(data,options);

    Data structure

    var data = [

        {

            value: 300,

            color:"#F7464A",

            highlight: "#FF5A5E",

            label: "Red"

        },

        {

            value: 50,

            color: "#46BFBD",

            highlight: "#5AD3D1",

            label: "Green"

        },

        {

            value: 100,

            color: "#FDB45C",

            highlight: "#FFC870",

            label: "Yellow"

        }

    ]

    For a pie chart, you must pass in an array of objects with a value and anoptional color property. The value attribute should be a number, Chart.js willtotal all of the numbers and calculate the relative proportion of each. Thecolor attribute should be a string. Similar to CSS, for this string you can useHEX notation, RGB, RGBA or HSL.

    Chart options

    These are the customisation options specific to Pie & Doughnut charts.These options are merged with the global chart configuration options, and form the options of the chart.

    {

        //Boolean -Whether we should show a stroke on each segment

        segmentShowStroke : true,

     

        //String -The colour of each segment stroke

        segmentStrokeColor : "#fff",

     

        //Number -The width of each segment stroke

        segmentStrokeWidth : 2,

     

        //Number -The percentage of the chart that we cut out of the middle

        percentageInnerCutout : 50, // This is 0 for Pie charts

     

        //Number -Amount of animation steps

        animationSteps : 100,

     

        //String -Animation easing effect

        animationEasing : "easeOutBounce",

     

        //Boolean -Whether we animate the rotation of the Doughnut

        animateRotate : true,

     

        //Boolean -Whether we animate scaling the Doughnut from the centre

        animateScale : false,

     

        //String -A legend template

        legendTemplate : "<ulclass=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0;i<segments.length; i++){%><li><spanstyle=\"background-color:<%=segments[i].fillColor%>\"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>"

     

    }

    You can override these for your Chart instance bypassing a second argument into the Doughnut method as anobject with the keys you want to override.

    For example, we could have a doughnut chart that animates by scaling outfrom the centre like so:

    new Chart(ctx).Doughnut(data, {

        animateScale: true

    });

    // This will create a chart with all of the defaultoptions, merged from the global config,

    // and the Doughnut chart defaults but this particularinstance will have `animateScale` set to `true`.

    We can also change these default values for each Doughnut type that iscreated, this object is available at Chart.defaults.Doughnut. Pie charts also have a clone of these defaults available to change at Chart.defaults.Pie, with the only difference being percentageInnerCutout being set to 0.

    Prototype methods

    .getSegmentsAtEvent( event )

    Calling getSegmentsAtEvent(event) on your Chart instance passing an argument of an event,or jQuery event, will return the segment elements that are at the same positionof that event.

    canvas.onclick = function(evt){

        var activePoints = myDoughnutChart.getSegmentsAtEvent(evt);

        // =>activePoints is an array of segments on the canvas that are at the sameposition as the click event.

    };

    This functionality may be useful for implementing DOM based tooltips, ortriggering custom behaviour in your application.

    .update( )

    Calling update() on your Chart instance will re-render the chart with anyupdated values, allowing you to edit the value of multiple existing points,then render those in one animated render loop.

    myDoughnutChart.segments[1].value = 10;

    // Would update the first dataset's value of 'Green' tobe 10

    myDoughnutChart.update();

    // Calling update now animates the circumference of thesegment 'Green' from 50 to 10.

    // and transitions other segment widths

    .addData( segmentData, index )

    Calling addData(segmentData,index) on your Chart instance passingan object in the same format as in the constructor. There is an optional secondargument of 'index', this determines at what index the new segment should beinserted into the chart.

    // An object in the same format as the original datasource

    myDoughnutChart.addData({

        value: 130,

        color: "#B48EAD",

        highlight: "#C69CBE",

        label: "Purple"

    });

    // The new segment will now animate in.

    .removeData( index )

    Calling removeData(index) on your Chart instance will remove segment at thatparticular index. If none is provided, it will default to the last segment.

    myDoughnutChart.removeData();

    // Other segments will update to fill the empty spaceleft.

    Advanced usage

    Prototype methods

    For each chart, there are a set of global prototype methods on the shared ChartType which you may find useful. These are available on all charts created withChart.js, but for the examples, let's use a line chart we've made.

    // For example:

    var myLineChart = new Chart(ctx).Line(data);

    .clear()

    Will clear the chart canvas. Used extensively internally between animationframes, but you might find it useful.

    // Will clear the canvas that myLineChart is drawn on

    myLineChart.clear();

    // => returns 'this' for chainability

    .stop()

    Use this to stop any current animation loop. This will pause the chartduring any current animation frame. Call .render() tore-animate.

    // Stops the charts animation loop at its current frame

    myLineChart.stop();

    // => returns 'this' for chainability

    .resize()

    Use this to manually resize the canvas element. This is run each time thebrowser is resized, but you can call this method manually if you change thesize of the canvas nodes container element.

    // Resizes & redraws to fill its container element

    myLineChart.resize();

    // => returns 'this' for chainability

    .destroy()

    Use this to destroy any chart instances that are created. This will cleanup any references stored to the chart object within Chart.js, along with anyassociated event listeners attached by Chart.js.

    // Destroys a specific chart instance

    myLineChart.destroy();

    .toBase64Image()

    This returns a base 64 encoded string of the chart in it's current state.

    myLineChart.toBase64Image();

    // => returns png data url of the image on the canvas

    .generateLegend()

    Returns an HTML string of a legend for that chart. The template for thislegend is at legendTemplate in the chart options.

    myLineChart.generateLegend();

    // => returns HTML string of a legend for this chart

    External Tooltips

    You can enable custom tooltips in the global or chart configuration likeso:

    var myPieChart = new Chart(ctx).Pie(data, {

        customTooltips: function(tooltip) {

     

            // tooltip will be false if tooltip is not visible or should be hidden

            if (!tooltip) {

                return;

            }

     

            // Otherwise, tooltip will be an object with all tooltip properties like:

     

            // tooltip.caretHeight

            // tooltip.caretPadding

            // tooltip.chart

            // tooltip.cornerRadius

            // tooltip.fillColor

            // tooltip.font...

            // tooltip.text

            // tooltip.x

            // tooltip.y

            // etc...

     

        };

    });

    See files sample/pie-customTooltips.html and sample/line-customTooltips.html forexamples on how to get started.

    Writing new chart types

    Chart.js 1.0 has been rewritten to provide a platform for developers tocreate their own custom chart types, and be able to share and utilise themthrough the Chart.js API.

    The format is relatively simple, there are a set of utility helper methodsunder Chart.helpers, including things such as looping over collections,requesting animation frames, and easing equations.

    On top of this, there are also some simple base classes of Chart elements,these all extend from Chart.Element, and include things such aspoints, bars and scales.

    Chart.Type.extend({

        // Passingin a name registers this chart in the Chart namespace

        name: "Scatter",

        //Providing a defaults will also register the deafults in the chart namespace

        defaults : {

            options: "Here",

            available: "at this.options"

        },

        //Initialize is fired when the chart is initialized - Data is passed in as aparameter

        // Configis automatically merged by the core of Chart.js, and is available at this.options

        initialize: function(data){

            this.chart.ctx // The drawing context for this chart

            this.chart.canvas // the canvas node for this chart

        },

        // Used todraw something on the canvas

        draw: function() {

        }

    });

     

    // Now we can create a new instance of our chart, usingthe Chart.js API

    new Chart(ctx).Scatter(data);

    // initialize is now run

    Extending existing chart types

    We can also extend existing chart types, and expose them to the API in thesame way. Let's say for example, we might want to run some more code when weinitialize every Line chart.

    // Notice now we're extending the particular Line charttype, rather than the base class.

    Chart.types.Line.extend({

        // Passingin a name registers this chart in the Chart namespace in the same way

        name: "LineAlt",

        initialize: function(data){

            console.log('My Line chart extension');

            Chart.types.Line.prototype.initialize.apply(this, arguments);

        }

    });

     

    // Creates a line chart in the same way

    new Chart(ctx).LineAlt(data);

    // but this logs 'My Line chart extension' in theconsole.

    Community extensions

    Creating custom builds

    Chart.js uses gulp to build the library into a single JavaScript file. We can use this samebuild script with custom parameters in order to build a custom version.

    Firstly, we need to ensure development dependencies are installed. Withnode and npm installed, after cloning the Chart.js repo to a local directory,and navigating to that directory in the command line, we can run the following:

    npm install

    npm install -g gulp

    This will install the local development dependencies for Chart.js, alongwith a CLI for the JavaScript task runner gulp.

    Now, we can run the gulp build task, and pass in a commaseperated list of types as an argument to build a custom version of Chart.jswith only specified chart types.

    Here we will create a version of Chart.js with only Line, Radar and Barcharts included:

    gulp build --types=Line,Radar,Bar

    This will output to the /custom directory, and write two files,Chart.js, and Chart.min.js with only those chart types included.

    Notes

    Browser support

    Browser support for the canvas element is available in all modern &major mobile browsers (caniuse.com/canvas).

    For IE8 & below, I would recommend using the polyfill ExplorerCanvas -available at https://code.google.com/p/explorercanvas/. It falls back to Internet explorer's format VML whencanvas support is not available. Example use:

    <head>

        <!--[iflte IE 8]>

            <scriptsrc="excanvas.js"></script>

       <![endif]-->

    </head>

    Usually I would recommend feature detection to choose whether or not toload a polyfill, rather than IE conditional comments, however in this case, VMLis a Microsoft proprietary format, so it will only work in IE.

    Some important points to note in my experience using ExplorerCanvas as afallback.

    • Initialise charts on load rather than DOMContentReady when using the library, as sometimes a race condition will occur, and it will result in an error when trying to get the 2d context of a canvas.
    • New VML DOM elements are being created for each animation frame and there is no hardware acceleration. As a result animation is usually slow and jerky, with flashing text. It is a good idea to dynamically turn off animation based on canvas support. I recommend using the excellent Modernizr to do this.
    • When declaring fonts, the library explorercanvas requires the font name to be in single quotes inside the string. For example, instead of your scaleFontFamily property being simply "Arial", explorercanvas support, use "'Arial'" instead. Chart.js does this for default values.

    Bugs & issues

    Please report these on the GitHub page - at github.com/nnnick/Chart.js. If you could include a link to a simple jsbin or similar to demonstrate the issue, that'd be reallyhelpful.

    Contributing

    New contributions to the library are welcome, just a couple of guidelines:

    • Tabs for indentation, not spaces please.
    • Please ensure you're changing the individual files in /src, not the concatenated output in the Chart.js file in the root of the repo.
    • Please check that your code will pass jshint code standards, gulp jshint will run this for you.
    • Please keep pull requests concise, and document new functionality in the relevant .md file.
    • Consider whether your changes are useful for all users, or if creating a Chart.js extension would be more appropriate.

    License

    Chart.js is open source and available under the MIT license.

     

    展开全文
  • 向一些人介绍一些信息的最好方法是使用图表...使用“守则”Download Chart.js你可以Chart.js从这封信中:https://github.com/chartjs/Chart.js/releases使用VisualStudio创建新的ASP.NET项目并复制Chart.js在上一步...
  • vue chart.js 图表是现代网站和应用程序的重要组成部分。 它们有助于呈现无法轻易用文本表示的信息。... Chart.js是面向开发人员和设计人员的简单而灵活JavaScript图表库,该库允许使用HTML5 ca...
  • vue-chartjs vue-chartjs是vue中Chart.js的包装。 您可以轻松创建可重复使用的图表组件。 演示和文档:television:演示:open_book:文档兼容性vue-chartjs vue-chartjs是vue中Chart.js的包装。 您可以轻松创建可重复...
  • chart.js 图表刷新Data is all around us. While search engines and other applications work most optimally with text based representation of data, people find data represented visually to be easy to ...
  • chart.min.jsThis article is included in our anthology, Modern JavaScript. If you want everything in one place to get up to speed on modern JavaScript, sign up for SitePoint Premium and download yourse...
  • chart.js

    2019-10-05 23:31:29
    chart.js Org Chart EditorChart.js | Open source HTML5 Charts for your website pos...
  • 深入学习 chart.js 的选项来制作漂亮的图表。交互式图表可以给你的数据可视化提供很酷的展示方式。但是大多数开箱即用的解决方案用默认的选项并不能做出很绚丽的图表。 这篇文章中,我会教你如何自定义 chart.js ...
  • Javascript图形库 Chart.js ,ChartJS 使用HTML5 Canvas元素的Javascript图形库,支持6种统计图形,不依...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 47,927
精华内容 19,170
关键字:

Chart.js