Comments (4)
can you clarify? when I enable the plugin and define a label for the dataset it works just fine.
window.onload = () => {
const ctx = document.getElementById("canvas").getContext("2d");
window.myBar = new Chart(ctx, {
type: 'funnel',
data: {
labels: ['Step 1', 'Step 2', 'Step 3'],
datasets: [{
label: 'Dataset 1',
data: [1, 0.75, 0.5]
}]
},
options: {
indexAxis: 'y',
plugins: {
title: {
display: true,
text: 'Chart.js Funnel Chart'
},
legend: {
display: true
}
}
},
plugins: [ChartDataLabels],
});
};
from chartjs-chart-funnel.
can you clarify? when I enable the plugin and define a label for the dataset it works just fine.
window.onload = () => { const ctx = document.getElementById("canvas").getContext("2d"); window.myBar = new Chart(ctx, { type: 'funnel', data: { labels: ['Step 1', 'Step 2', 'Step 3'], datasets: [{ label: 'Dataset 1', data: [1, 0.75, 0.5] }] }, options: { indexAxis: 'y', plugins: { title: { display: true, text: 'Chart.js Funnel Chart' }, legend: { display: true } } }, plugins: [ChartDataLabels], }); };
Isn't there any way to use the labels as legends instead of the datasets?
In your example the legend is for Dataset 1. Can the legends be Step 1; Step 2 and Step 3 with each corresponding color?
Thank you for your response.
from chartjs-chart-funnel.
you are asking about a categorical color legend?
similar to https://github.com/sgratzl/chartjs-chart-geo
bottom right color legend but for the categories (Step 1, Step 2, Step 3)?
AFAIK there is no chartjs plugin that currently implements something like this. This plugin implements a funnel chart using a single dataset consisting of multiple data points. Not sure whether it could be swapped the other way around, since internally different datasets are handled independently making the stepping effect quite difficult.
from chartjs-chart-funnel.
you are asking about a categorical color legend?
similar to https://github.com/sgratzl/chartjs-chart-geo bottom right color legend but for the categories (Step 1, Step 2, Step 3)?
AFAIK there is no chartjs plugin that currently implements something like this. This plugin implements a funnel chart using a single dataset consisting of multiple data points. Not sure whether it could be swapped the other way around, since internally different datasets are handled independently making the stepping effect quite difficult.
Yeah, i figured.
I'll see what I can do but I appreciate your answer. Thank you for the help.
Cheers.
from chartjs-chart-funnel.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chartjs-chart-funnel.