mercredi 7 juin 2017

Non numeric for x-axis in scatter chart in CHART.js

I am trying to generate a scatter chart using chartjs. In my scatter chart i want the x-axis ie the labels to be a string. But if i try the below code i get numbers in my x-axis label

datasets: [{
        label: 'Scatter Dataset',
        data: [{
            x: "a",
            y: 0
        }, {
            x: "b",
            y: 3
        }, {
            x: "",
            y: 5
        }]
    }]

enter image description here

How to set my x-axis as string values and make the graph work?




Aucun commentaire:

Enregistrer un commentaire