-
Notifications
You must be signed in to change notification settings - Fork 19.7k
feat: new theme for ECharts 6.0 #20865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v6
Are you sure you want to change the base?
Conversation
Thanks for your contribution! The pull request is marked to be |
The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-20865@c448109 |
Very professional design, looking forward to the official release of 6.0! |
Great design! Just one question, will there be enough contrast to the surface(maybe |
In the above commit, I added a new option v5![]() v6![]() Option is: {
show: true,
realtime: true,
start: 30,
end: 70
},
{
show: true,
realtime: true,
yAxisIndex: 0
} and {
show: true,
realtime: true,
start: 30,
end: 70,
top: 50
},
{
show: true,
realtime: true,
yAxisIndex: 0,
left: 25
} |
@@ -36,6 +36,7 @@ import { | |||
} from '../../util/types'; | |||
import GlobalModel from '../../model/Global'; | |||
import Model from '../../model/Model'; | |||
import tokens from '../../visual/tokens'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the default year should not be that dark since it has been a large text, but the month and day label should be dark because they are more important ticks than year (they are like axis ticks in cartesian).
And a light month and day label will bring that bad case in dark background:
-- new style --
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the year label to be a lighter gray, but not as light as v5. I don't quite believe we should make it lighter since it's larger. It's larger because it's more prominant, so it gives more reason to make it darker.

Dark background should not be considered in this case. If user wants to use dark background, he, or the one who makes the dark theme should be responsible for changing the label colors to fit the background. And whatever color you choose for the default label, it's still possible that the user set the background to a similar color (a black background for example).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the report of visual tests using current remote v6
branch and local code with v5.js
theme file. There are only two imcompatible changes:
- Sunburst series color
In v5, the first theme color was used for the drill-down return node, causing the default view to start from the second theme color, making it look different from other charts. Therefore, it was changed to use gray for drill-down nodes and series use theme colors starting from the first one instead of the second one.
- Loading spinner and text color
Since these colors are not using a registered theme, it cannot be override. But the change is acceptable.
All other diffs in the test report are due to the false alarm of the visual test tool and should be ignored.
In the last commit, I implemented a way to support "Mark As Expected" Feature for the test tool so that we can see clearly in the report which diffs are expected.
Here is the full report:
Visual Regression Test Report-v6-theme.html.zip
Brief Information
This pull request is in the type of:
What does this PR do?
This PR proposes a new default theme for Apache ECharts 6.0.
Design Concepts
Key Words: Modern, Confident, Versatile
Challenges
We have observed that many Apache ECharts users use the default theme in their actual products, which presents a significant challenge for us to provide an excellent default theme. When designing the new theme for 6.0, I aimed to address the following issues:
Solution
Therefore, I have defined color and distance tokens uniformly in the
tokens.ts
file. By referencing these variables, we can ensure design consistency and improve code readability. Then, I refined the spacing and positioning of each component and chart to ensure elegant display under different chart types and series quantities.In terms of theme color design, I chose colors with higher value (brightness), injecting more modern vitality into the charts, conveying a confident and clear visual language that makes data expression more attractive. The new color scheme is bold and innovative while maintaining continuity - the first two theme colors (blue and green) retain their hue, preserving familiar visual anchors while injecting freshness into the overall style.
Before & After
In
test/theme-list.html
, I have provided examples of typical chart types and components with series quantities ranging from 1 to 9. Here, we will explain some typical charts.Typical Charts
Let's start by experiencing the new design with common 4-series bar and pie charts.
In ECharts 5, the
title
andlegend
often overlap. Before we come up with a better layout plan, I moved thelegend
to the bottom, not only avoiding overlap but also creating a more balanced layout visually with thetitle
. We left more space at the bottom of thegrid
to prevent overlap even with multiple legend items, and enabledcontainLabel
by default to ensure axis labels don't exceed the canvas when data values are large.Theme Colors
To handle different chart usage scenarios, we need to ensure the theme colors look harmonious with different numbers of series. Below, using bar charts as an example, we show the effects with 1-9 series, and then explain how we balance the design as series number varies.
How to Ensure Theme Color Harmony
The biggest challenge in designing theme colors is how to ensure distinction while maintaining overall harmony when there are many series?
Warm-Cool Consistency
This inspiration came from a painting course where I learned this technique: when multiple colors are needed in a composition, overall harmony can be achieved by unifying the warm-cold nature of the colors.
In the image above, we can see that colors with consistent warm-cold tones appear more harmonious when grouped together. In the theme colors I propose, I use colors that lean towards cool tones because cool colors give a sense of professionalism and trustworthiness, which is more suitable for most chart scenarios.
Value and Lightness Variation
If we carefully observe the three-series bar chart, we can see that the color scheme in 6 is more harmonious than 5. Why is that?
After converting to grayscale, we can see the reason more clearly.
When lightness follows a monotonically linear progression (as seen in ECharts 5's first three series), it introduces visual instability. By implementing dynamic lightness modulation through non-linear curves, we achieve both enhanced accessibility and harmonious aesthetics.
Besides lightness, value also needs this kind of variation, so the third theme color uses a lower value to make the overall look more balanced. If the third theme color used a similar value (like the orange we ultimately placed in the fourth position), although it wouldn't feel out of place, I think it would lack some sophistication from an aesthetic perspective, as it would be like a tripod lacking focus, making it an unstable design.
Common Charts and Components
Due to space limitations, we cannot show the effects of different series quantities for various charts here, only showing the effects with four series as an example. The complete examples can be found in the zip file attached. echarts-themes-v5-vs-v6.zip
Bar Chart
Hid
axisTick
for 'category' axis because in most cases, the distance relationship already indicates grouping information, andaxisTick
is not needed for precise division. Removing it makes the visual more continuous and reduces unnecessary redundant information. More space is left at the bottom of the grid to prevent overlap when the legend has two rows.Line Chart
Increased
lineStyle.width
andsymbolSize
, making the overall look more modern and confident. The originalsymbolSize
was too close to the line width, lacking distinction, thus not aesthetically pleasing.Pie Chart
Reduced
radius
to add more whitespace for aesthetic appeal and avoid overlap with other components. IncreasedlabelLine
width.Scatter Chart
Funnel Chart
Treemap Chart
The original layout used percentage positioning on the left and right, which was changed to fixed pixel size, and this size is the same as the margin used by other components (such as heatmap controls, Toolbox, etc.). The original
breadcrumb
dark gray background was visually too heavy, but logically it's not the main information, so it was changed to a light gray background.Sunburst Chart
Originally, the first theme color was used for the drill-down return node, causing the default view to start from the second theme color, making it look different from other charts. Therefore, it was changed to use gray for drill-down nodes.
ThemeRiver Chart
Random data so it doesn't look very similar, but this chart actually didn't have significant changes.
Timeline
Adjusted colors to avoid using gray which might be mistaken for disabled state. Redrew icon SVGs to maintain width consistency. Removed strokes and shadows because ECharts' overall design is flat, and shadows should be avoided when they don't help prevent misunderstanding.
DataZoom & Toolbox
Adjusted colors to avoid using gray which might be mistaken for disabled state.
VisualMap & Calendar
ECharts 5 used a red to yellow gradient, but this color only appeared in VisualMap, lacking connection with the overall design. It was adjusted to a gradient related to the first theme color to make it more consistent with other charts and avoid the warning implications of red, since larger values don't always indicate better or worse. The VisualMap control has more whitespace on the sides, with this distance matching the margins of other components. Slightly adjusted Calendar colors.
Map
The yellow highlight background in ECharts 5 maps wasn't used anywhere else, making it inconsistent with the overall design. Actually, this highlight is similar to the color lifting after emphasis in bar charts, but making it lighter made it hard to see, so it was changed to a slightly darker background color.
Dark Mode
Examples of some dark mode charts:
To see more cases, toggle system dark mode and check
test/theme-list.html
. (ecomfe/zrender#1118 is required for zrender).Document Info
One of the following should be checked.
Misc
ZRender Changes
Related test cases or examples to use the new APIs
N.A.
Others
Merging options
Other information