Chart Demo Description
This page demonstrates adding and displaying charts in CanvasX. You can use chart widgets to visualize data, create dashboards, or enhance your diagrams with dynamic visualizations.
Chart Widget Documentation
Overview
CanvasX supports embedding charts as objects on the canvas. Charts can be used to visualize data, track metrics, or present information in a graphical format.
Key Properties
- type: string — The type of chart (e.g., 'bar', 'line', 'pie').
- data: object — The data to be visualized.
- width, height: number — The dimensions of the chart.
- top, left: number — The position of the chart on the canvas.
Usage Example
const chart = new XChart({ type: 'bar', data: { labels: [...], datasets: [...] }, top: 100, left: 100, width: 400, height: 300, }); canvas.add(chart);
Tips & Best Practices
- Choose the appropriate chart type for your data.
- Combine charts with notes and shapes for dashboards.
- Resize and position charts for clarity and emphasis.