Documentation Index
Fetch the complete documentation index at: https://mintlify.com/highcharts/highcharts/llms.txt
Use this file to discover all available pages before exploring further.
Chart Configuration and Structure
Highcharts charts are created by passing a configuration object to the chart constructor. Understanding the chart structure and configuration options is fundamental to creating effective visualizations.Creating a Chart
The basic pattern for creating a Highcharts chart involves initializing it with a configuration object:Chart Structure
Every Highcharts chart consists of several key components:- Chart Container
- Title & Subtitle
- Chart Events
The Key Properties:
chart object defines the chart type, dimensions, and rendering options.type- Default series type for the chartrenderTo- DOM element ID where chart renderszoomType- Enable mouse zooming on x, y, or both axespolar- Convert the chart to polar coordinates
Chart Methods
Once created, chart instances expose methods for dynamic updates:Chart Types
Highcharts supports numerous chart types through thechart.type option:
| Type | Description | Use Case |
|---|---|---|
line | Line chart | Trends over time |
column | Vertical bars | Comparing categories |
bar | Horizontal bars | Ranking data |
area | Area chart | Cumulative values |
pie | Pie chart | Part-to-whole relationships |
scatter | Scatter plot | Correlation analysis |
bubble | Bubble chart | Three-dimensional data |
heatmap | Heat map | Matrix data visualization |
The chart type can be set globally with
chart.type or overridden per series with series.type.Real-World Example
Here’s a complete chart configuration with multiple features:Chart Options Interface
The complete TypeScript interface fromChartOptions.ts:
The default series type for the chart. Can be any of the chart type options.
An explicit width for the chart. By default, the chart adapts to the container element’s width.
An explicit height for the chart. If not set, the height is calculated from the offset height of the containing element.
The background color for the chart area.
Decides in what dimensions the user can zoom by dragging the mouse.
When true, cartesian charts like line, spline, area, and column are transformed into the polar coordinate system.
Event listeners for the chart. Events include:
load, render, addSeries, click, selection.Best Practices
- Container Setup - Ensure your container element has defined dimensions
- Performance - Use
chart.reflow()instead of recreating charts on resize - Accessibility - Include descriptive titles and axis labels
- Responsive Design - Use the responsive options for mobile-friendly charts
Next Steps
Series Configuration
Learn about configuring data series
Axes
Configure chart axes and scales
Responsive Charts
Make charts responsive to screen size
Options
Explore all configuration options