Chart.js: show Dataset label on Chart

Created on 4 Feb 2014  路  6Comments  路  Source: chartjs/Chart.js

When i going to show a line chart or bar chart should have the option to display a label for each dataset.

Example:

new Chart(ctx).Line(data, options);
var options = {
    showDatasetLabels : true
}
var data = {
    labels : ["January","February","March","April","May","June","July"],
    datasets : [
        {
            label: "Salesman A",
            fillColor : "rgba(220,220,220,0.5)",
            strokeColor : "rgba(220,220,220,1)",
            pointColor : "rgba(220,220,220,1)",
            pointStrokeColor : "#fff",
            data : [65,59,90,81,56,55,40]
        },
        {
            label: "Salesman B",
            fillColor : "rgba(151,187,205,0.5)",
            strokeColor : "rgba(151,187,205,1)",
            pointColor : "rgba(151,187,205,1)",
            pointStrokeColor : "#fff",
            data : [28,48,40,19,96,27,100]
        }
    ]
}
enhancement

Most helpful comment

I have the same problem, the proposed fix is for TOOLTIP not VALUE LABELs, we are going to show charts on large screen as dashboard, so there is no mouse to hover, how can I show values on each Bar or Column

All 6 comments

It would be a very nice addition, I'm following this too. Thank you.

Yeah I need this right now.

Closing since there is a fix

The above solution is not correct solution. The ask was for label and the proposed solution is to show in label in tooltip. I have a similar problem, In my case my application is projected on big screen and there is no user interaction on chart to generate tooltip. It would be good if we can show label on lines in the chart

I have the same problem, the proposed fix is for TOOLTIP not VALUE LABELs, we are going to show charts on large screen as dashboard, so there is no mouse to hover, how can I show values on each Bar or Column

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bytesnz picture bytesnz  路  3Comments

nanospeck picture nanospeck  路  3Comments

HeinPauwelyn picture HeinPauwelyn  路  3Comments

JewelsJLF picture JewelsJLF  路  3Comments

gabrieldesouza picture gabrieldesouza  路  3Comments