-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
feature-requestNew feature or requestNew feature or request
Description
Problem Description
When exporting charts (PNG/SVG), ApexCharts does not properly respect the background and foreColor settings in the export configuration, particularly when using dark themes.
Current Behavior
- Charts display correctly on the website with dark backgrounds and white text
- When exported, charts have white backgrounds with white text (invisible)
- The
chartOptionsin export configuration doesn't override the background/foreground colors - This makes exported charts unusable for dark-themed applications
Expected Behavior
- Export configuration should allow overriding background and foreground colors
chartOptions.backgroundandchartOptions.foreColorshould work in export settings- Exported charts should maintain proper contrast (dark background + white text OR white background + black text)
Code Example
export: {
png: {
filename: 'chart.png',
chartOptions: {
chart: {
background: '#171717', // Should work but doesn't
foreColor: '#ffffff' // Should work but doesn't
}
}
}
}Workarounds Attempted
- Setting
backgroundandforeColorin main chart config - Using
chartOptionsin export configuration - Custom export handlers with
updateOptions() - Using
dataURI()method with temporary color changes
None of these approaches consistently work across different chart types.
Use Case
Dark-themed applications need to export charts that maintain the dark theme for:
- Reports and documentation
- Presentations
- Sharing with stakeholders
- Printing (when appropriate)
Proposed Solution
Add proper support for chartOptions in export configuration, or add specific export-only properties like:
exportBackgroundexportForeColorexportTheme
Environment
- ApexCharts version: [latest]
- Browser: All browsers
- Chart types: All types (donut, pie, bar, line, etc.)
Additional Context
This is a critical issue for applications that use dark themes, as exported charts become completely unusable due to invisible text on white backgrounds.
Metadata
Metadata
Assignees
Labels
feature-requestNew feature or requestNew feature or request