Home > Enterprise >  I want to show decimal values on my y axis but my chart doesn't show data how can i fix it?
I want to show decimal values on my y axis but my chart doesn't show data how can i fix it?

Time:07-15

This is my chart code my x axis value correct but y axis value is not working

 <script>
     

    const config = {
        type: 'line',
        data: {
            datasets: [{
                data: <%=lineData%>
            }]
        },
        options: {
            scales: {
                yAxes: [{
                    ticks: {
                        beginAtZero: true,
                        stepSize: 2
                    }
                }]
            }
        }
        
    };
</script>

<script>
const myChart = new Chart(
    document.getElementById('myChart'),
    config
);
</script>

and this is my chart,

debugged value is correct but they does not on my chart

CodePudding user response:

The problem is ',' on the y-axis value, change it to '.'

data: [{x: 17.05.2022 19:44:47, y: 28.28}]
  • Related