mirror of
https://github.com/kjanat/livedash-node.git
synced 2026-01-16 09:32:08 +01:00
Enhances data handling and geographic mapping
Refactors dashboard to use actual metrics for country data, removing dummy data for improved accuracy. Integrates the country-code-lookup package for geographic mapping, adding comprehensive country coordinates. Increases performance and data validation across API endpoints and adjusts WordCloud component size for better visualization. Enhances session handling with improved validation logic, and updates configuration for allowed origins.
This commit is contained in:
@ -92,12 +92,17 @@ export default function DonutChart({ data, centerText }: DonutChartProps) {
|
||||
{
|
||||
id: "centerText",
|
||||
beforeDraw: function (chart: any) {
|
||||
const width = chart.width;
|
||||
const height = chart.height;
|
||||
const ctx = chart.ctx;
|
||||
ctx.restore();
|
||||
|
||||
const centerX = width / 2;
|
||||
// Calculate the actual chart area width (excluding legend)
|
||||
// Legend is positioned on the right, so we adjust the center X coordinate
|
||||
const chartArea = chart.chartArea;
|
||||
const chartWidth = chartArea.right - chartArea.left;
|
||||
|
||||
// Get the center of just the chart area (not including the legend)
|
||||
const centerX = chartArea.left + chartWidth / 2;
|
||||
const centerY = height / 2;
|
||||
|
||||
// Title text
|
||||
|
||||
Reference in New Issue
Block a user