Several usages (39 to be exact) of the @elastic/chartsChart component are not correctly tied to the dark-mode-specific base theme. This leads to bad colors in these charts and issues when upgrading/changing chart themes.
An example of this is like below, where the chart consumer uses the Settings spec but does not supply any baseTheme so chart defaults to using the LIGHT_THEME.
All charts should be wired up the the correct dark-mode-specific theme.
Any additional context:
This is only a temporary fix as people that come along and add new charts could create more usages like this. To future proof this issue and prevent this from happening again, we can do something like https://github.com/elastic/kibana/pull/114839.
Kibana version:
main
Describe the bug:
Several usages (39 to be exact) of the
@elastic/charts
Chart
component are not correctly tied to the dark-mode-specific base theme. This leads to bad colors in these charts and issues when upgrading/changing chart themes.An example of this is like below, where the chart consumer uses the
Settings
spec but does not supply anybaseTheme
so chart defaults to using theLIGHT_THEME
.https://github.com/elastic/kibana/blob/eac36e8024db3f3048d74dd9e3f1eff6196177dd/x-pack/plugins/ml/public/application/memory_usage/nodes_overview/memory_preview_chart.tsx#L119-L123
List of bad usages
examples/response_stream/public/containers/app/pages/page_reducer_stream/index.tsx
src/plugins/chart_expressions/expression_tagcloud/public/components/tagcloud_component.tsx
x-pack/packages/ml/data_grid/components/column_chart.tsx
x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_trend_graph.tsx
x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/boolean_content.tsx
x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_row/column_chart.tsx
x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/metric_distribution_chart/metric_distribution_chart.tsx
x-pack/plugins/data_visualizer/public/application/data_drift/charts/data_drift_distribution_chart.tsx
x-pack/plugins/data_visualizer/public/application/data_drift/charts/overlap_distribution_chart.tsx
x-pack/plugins/data_visualizer/public/application/data_drift/charts/single_distribution_chart.tsx
x-pack/plugins/enterprise_search/public/applications/analytics/components/analytics_overview/analytics_collection_card/analytics_collection_card.tsx
x-pack/plugins/infra/public/pages/logs/log_entry_categories/sections/top_categories/single_metric_sparkline.tsx
x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/feature_importance/decision_path_chart.tsx
x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/total_feature_importance_summary/feature_importance_summary.tsx
x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container.js
x-pack/plugins/ml/public/application/explorer/swimlane_container.tsx
x-pack/plugins/ml/public/application/jobs/jobs_list/components/datafeed_chart_flyout/datafeed_chart_flyout.tsx
x-pack/plugins/ml/public/application/jobs/new_job/pages/components/charts/anomaly_chart/anomaly_chart.tsx
x-pack/plugins/ml/public/application/jobs/new_job/pages/components/charts/event_rate_chart/event_rate_chart.tsx
x-pack/plugins/observability/public/components/custom_threshold/components/expression_chart.tsx
x-pack/plugins/observability/public/embeddable/slo/overview/slo_overview.tsx
x-pack/plugins/observability/public/pages/overview/components/sections/logs/logs_section.tsx
x-pack/plugins/observability/public/pages/overview/components/sections/uptime/uptime_section.tsx
x-pack/plugins/observability/public/pages/slos/components/card_view/slo_card_item.tsx
x-pack/plugins/profiling/public/components/flamegraph/index.tsx
x-pack/plugins/security_solution/public/common/components/charts/areachart.tsx
x-pack/plugins/security_solution/public/common/components/charts/barchart.tsx
x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_panel.tsx
x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item.tsx
x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_timing_breakdown/network_timings_donut.tsx
x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_bar_chart.tsx
x-pack/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_chart_fixed_axis.tsx
x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/barchart.tsx
x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/execution_duration_chart.tsx
x-pack/plugins/uptime/public/legacy_uptime/components/common/charts/duration_chart.tsx
x-pack/plugins/uptime/public/legacy_uptime/components/common/charts/monitor_bar_series.tsx
x-pack/plugins/uptime/public/legacy_uptime/components/common/charts/ping_histogram.tsx
x-pack/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_bar_chart.tsx
x-pack/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_chart_fixed_axis.tsx
Expected behavior:
All charts should be wired up the the correct dark-mode-specific theme.
Any additional context:
This is only a temporary fix as people that come along and add new charts could create more usages like this. To future proof this issue and prevent this from happening again, we can do something like https://github.com/elastic/kibana/pull/114839.
cc: @markov00 & @gvnmagni