We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I tried mix bar and line chart However I can only create
You can give me some solution ?
`import { Chart, Line } from "react-chartjs-2";
import React from "react";
const options = { responsive: true, maintainAspectRatio: false, aspectRatio: 1, layout: { padding: { top: 30, }, }, plugins: { legend: { display: false, }, datalabels: { display: false, }, }, scales: { y: { type: "linear", display: true, position: "left", ticks: { color: "rgba(0, 0, 0, 1)", }, grid: { drawBorder: true, drawTicks: true, color: "rgba(0, 0, 0, 0.2)", }, title: { display: true, font: { size: 17, }, }, }, y1: { type: "linear", display: true, position: "right", title: { display: true, font: { size: 15, }, }, }, }, }; export default function MixChartUI({ labels }) { //! state const chartData = { labels: ["2000", "2001", "2002", "2003", "2004"], datasets: [ { type: "bar", data: [5, 4, 3, 2, 1], yAxisID: "y1", yAxesGroup: "a", backgroundColor: "rgb(190, 50, 216)", order: 2, }, { type: "line", data: [2, 4, 6, 8, 10], backgroundColor: rgba(100,200,255), yAxisID: "y", yAxesGroup: "a", order: 1, lineTension: 0, steppedLine: true, },
rgba(100,200,255)
{ type: "bar", data: [10, 23, 12, 9, 6], yAxisID: "y1", backgroundColor: "rgb(190, 50, 216)", order: 2, }, { type: "line", data: [5, 1, 4, 2, 8], backgroundColor: "red", yAxisID: "y", order: 1, }, ], }; //! function //! render return ( <div className="h-full"> <Line data={chartData} options={options} /> </div> );
} `
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Would you like to work on this feature?
What problem are you trying to solve?
I tried mix bar and line chart
However I can only create
You can give me some solution ?
Describe the solution you'd like
Describe alternatives you've considered
`import { Chart, Line } from "react-chartjs-2";
import React from "react";
const options = {
responsive: true,
maintainAspectRatio: false,
aspectRatio: 1,
layout: {
padding: {
top: 30,
},
},
plugins: {
legend: {
display: false,
},
datalabels: {
display: false,
},
},
scales: {
y: {
type: "linear",
display: true,
position: "left",
ticks: {
color: "rgba(0, 0, 0, 1)",
},
grid: {
drawBorder: true,
drawTicks: true,
color: "rgba(0, 0, 0, 0.2)",
},
title: {
display: true,
font: {
size: 17,
},
},
},
y1: {
type: "linear",
display: true,
position: "right",
title: {
display: true,
font: {
size: 15,
},
},
},
},
};
export default function MixChartUI({ labels }) {
//! state
const chartData = {
labels: ["2000", "2001", "2002", "2003", "2004"],
datasets: [
{
type: "bar",
data: [5, 4, 3, 2, 1],
yAxisID: "y1",
yAxesGroup: "a",
backgroundColor: "rgb(190, 50, 216)",
order: 2,
},
{
type: "line",
data: [2, 4, 6, 8, 10],
backgroundColor:
rgba(100,200,255)
,yAxisID: "y",
yAxesGroup: "a",
order: 1,
lineTension: 0,
steppedLine: true,
},
}
`
Documentation, Adoption, Migration Strategy
No response
The text was updated successfully, but these errors were encountered: