Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using candlestick type, and adding "scatter" type, the dots are connected with line #46

Closed
tomthedude opened this issue Oct 26, 2018 · 1 comment

Comments

@tomthedude
Copy link

tomthedude commented Oct 26, 2018

hello,
i am using candlestick, and when i am adding scattered dots, the are being connected with line.
and when i remove the candlestick type and use only scatter, it works ok (all on the same graph of course), i have attached photo of both:
candles + scatter:
cansca

scatter only:
scatonly

here is the chart conf:

new Chart(ctx, {
   type: 'candlestick',
    data: {
        datasets: [{
            label: 'BTC-ADA',
            data: candles
        },{
        label: 'Buys',
                    data: buys,
                    borderColor: "green",
                    fill: false,
                     type: 'scatter',
        },{
        label: 'Sells',
                    data: sells,
                    fill: false,
                    borderColor: "red",
                     type: 'scatter',
        }]
    },
    options: {
        
        tooltips: {
					position: 'nearest',
					mode: 'index',
				},						pan: {
						enabled: true,
						mode: 'xy',
						speed: 10,
						threshold: 10
					},
        			    zoom: {
						enabled: true,
						mode: 'xy',
						limits: {
							max: 10,
							min: 0.5
						}
					},
   
    }
		});

please advise how to fix this bug.

@benmccann
Copy link
Collaborator

Yes, unfortunately Chart.js has lots of issues with mixed chart types because the options from the various charts collide with each other. I'd like for this to improve. You can see more details here: chartjs/Chart.js#5151

Ultimately I think this is a bug in the upstream library and there's already a handful of bugs filed there to track it, so I'm going to close this for now. If you'd like to contribute towards fixing the bug we really need some help with chartjs/Chart.js#5191

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants