phibr0 / obsidian-charts

Charts - Obsidian Plugin | Create editable, interactive and animated Charts in Obsidian via Chart.js
https://charts.phib.ro/
GNU Affero General Public License v3.0
568 stars 26 forks source link

Include date library adapter #31

Closed selfire1 closed 2 years ago

selfire1 commented 2 years ago

Hi! I stumbled upon this trying to find a workaround for #29.

I try to set an axis to a Time Cartesian Axis like so:

const chartData = {
    type: 'scatter',
    data: data,
    options: {
        scales: {
            x: {
                type: 'time',
                time: {
                    unit: 'day'
                }
            }
        }
    }
};

However, I get this error: Error: This method is not implemented: Check that a complete date adapter is provided..

I'd love for a date adapter to be included in the plugin! Here is a list of supported adapters for reference.

I am a bit out of my depth here, so there might be something I misunderstood. Thanks for the amazing plugin!

phibr0 commented 2 years ago

I think I can just add the moment adapter, since moment is used in Obsidian anyway. Could you please try the new Release?

selfire1 commented 2 years ago

Hi @phibr0, thanks for adding the adapter. I upgraded to 3.1.0 but can't enable Obsidian Charts. There seems to be an issue with finding moment.

image

phibr0 commented 2 years ago

Thats weird.. It works fine for me. What Obsidian Version are you using?

selfire1 commented 2 years ago

I'm on 0.12.19. Super weird… I restarted Obsidian, my computer and deinstalled and reinstalled Obsidian Charts but can't enable it. Same error as mentioned above.