Git Product home page Git Product logo

Comments (5)

Makanz avatar Makanz commented on June 16, 2024

Have you looked at the examples? Need more information of whats not working.
Can you create a jsfiddle that I can look at?

from chartjs-plugin-trendline.

Sjos12 avatar Sjos12 commented on June 16, 2024

I'm getting the same issue while using Chartisan. I'm getting no errors in the console, I'm importing the plugin via the cdn. Here's the code.

const chartisan = new Chartisan({
            el: `#chart${id}`,
            data: chart,
            hooks: new ChartisanHooks()
            .legend(true)
            .colors(colorarray)
            .datasets(objectarray)
            .padding({
                left: 0, 
                right: 0, 
                bottom: 0, 
                top: 20,
            })
            .options({
                options: {
                   // animation,
                    maintainAspectRatio: false,
                    plugins: { 
                        datalabels: {
                            anchor: 'center',
                            clamp: true,
                            align: 'top', 
                            color: () => { 
                                if (type === 'bar'){ 
                                    return 'white'
                                } else {
                                    return '#5D2A42'
                                }
                            },
                        },
                        tooltip: { 
                            enabled: false,
                        },
                        legend: { 
                            position: 'bottom',
                            fullSize: true,
                            labels: {
                                boxHeight: 5,
                                textAlign: 'left',
                                usePointStyle: true,

                                // This more specific font property overrides the global property
                                font: {
                                    size: 15,
                                    family: 'Roboto', 
                                    weight: 'thin',

                                }
                            }
                        }
                    },
                    scales: {       
                        x: {
                            grid: {
                                color: 'white',
                                borderWidth: 2,
                                tickWidth: 2,
                                tickLength: 8,
                                offset: false,
                                borderColor: `rgba(93, 42, 66, ${borderopacity})`,
                                tickColor: '#FFFFFF',
                            },
                            type: 'time',
                            time: { 
                                unit: 'day'
                            },

                        },
                        y: {
                            beginAtZero: () => {
                                if (type == 'bar') {
                                    return true
                                }
                                return false
                            },
                            grid: {
                                color: 'white',
                                borderWidth: 2,
                                tickWidth: 2,
                                tickLength: 8,
                                offset: false,
                                borderColor: `rgba(93, 42, 66, ${borderopacity})`,
                                tickColor: '#FFFFFF',
                            },
                            ticks: {
                                // Include a unit in the ticks
                                callback: function(value, index, values) {
                                    return value + unit;
                                }
                            },

                        }
                    }
                }
            })
        })

from chartjs-plugin-trendline.

bbohling avatar bbohling commented on June 16, 2024

@Sjos12 - I had the same issue...try commenting out type: time. for some reason trendline can't handle that type.

@Makanz are you aware of this issue?

from chartjs-plugin-trendline.

Makanz avatar Makanz commented on June 16, 2024

I have never used Chartisan so I can unfortunately not help you with that.

from chartjs-plugin-trendline.

leinad9905 avatar leinad9905 commented on June 16, 2024

@bbohling encountering the same issue you had but we weren't able to remove type: time yet, did you come up with a solution that could work with type: time ?

from chartjs-plugin-trendline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.