Closed mouise1111 closed 3 weeks ago
Also having the same issue,i have noticed though that most examples use render() which is reactjs. Can't the heatmap be used without the render() function?
Also having the same issue,i have noticed though that most examples use render() which is reactjs. Can't the heatmap be used without the render() function?
The library can be used without react, the render()
function is used only because the documentation script is using react to render live example
But still, it won't work
I'm running in the same issue.
Edit: found this one: https://github.com/wa0x6e/cal-heatmap/issues/516 where ISS-Ltd-Web found out you have to add the x and y properties in the data.
working example:
const heatmap_options = {
itemSelector: "#cal-heatmap",
domain: {type: 'year'},
subDomain: {type: 'day'},
date: {
locale: {weekStart: 1},
highlight: [new Date()],
min: new Date('2024-01-01'),
max: new Date('2024-12-31'),
},
data: {
source: [
{ date: '2024-01-01', value: 3 },
{ date: '2024-01-02', value: 6 },
],
x: (datum) => +new Date(datum['date']),
y: (datum) => +datum['value']
},
verticalOrientation: false,
animationDuration: 500,
theme: 'light',
scale: {
color: {
scheme: 'Cool',
type: 'linear'
},
},
//range: number,
//label: LabelOptions,
};
const calHeatmap = new CalHeatmap();
calHeatmap.paint(heatmap_options);
@Pin0, thanks it work as soon as i included x and y properties
Hi, I am trying to display some static data on the heatmap. Here is my current code, I don't understand what I am doing wrong.
Kind regards.