Skip to content

Can't draw horizontal line on react-charts-js with CoreUI template #515

Answered by JRA98
JRA98 asked this question in Q&A
Discussion options

You must be logged in to vote

Im finally get it works!!

I have directly modified the main node_modules/@coreui/react-chartjs/src/CChart.js library file and extracted it into my libraries folder.

And added the following lines at the start

import {
    Chart,
    LineController,
    LineElement,
    PointElement,
    CategoryScale,
    LinearScale
} from "chart.js";

import annotationPlugin from 'chartjs-plugin-annotation';
import { customTooltips as cuiCustomTooltips } from '@coreui/chartjs'
import '@coreui/chartjs/dist/css/coreui-chartjs.css'

Chart.register(
    LineController,
    LineElement,
    PointElement,
    CategoryScale,
    LinearScale,
    annotationPlugin
);

Then on my Chart Component I read from the …

Replies: 8 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by JRA98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #515 on December 01, 2021 13:52.