chartjs / chartjs-chart-financial

Chart.js module for charting financial securities
MIT License
725 stars 197 forks source link

How do I change the display of time? #31

Closed rashearth closed 6 years ago

rashearth commented 6 years ago

Hello.

Now, I am making a candlestick chart by using the data below . { t: 'April 01 2018', o: 70.87, h: 80.13, l: 40.94, c: 50.24 },

The problem is that the x axis doesn't display as "April 01" it says "12:00.00.000am". Could you please help me how I can fix the time to "April 01"?

rashearth commented 6 years ago

Okay, I fixed this by simply adding the options as below.

scales: { xAxes: [{

                    type: 'time',
                    display:true,
                    time: {
                        minUnit:'day',
                    },
                    scaleLabel: {
                        display: true,
                        labelString: 'Date'
                    }
                }],

    },
prachi96 commented 6 years ago

This worked. Thank you so much. @rashearth