Lädt...


🔧 In vchart, how do I set the legend not to follow the gradient color and draw a rounded rectangle legend?


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

Question Title

In vchart charts, how do I set the legend not to follow the gradient color and draw a rounded rectangle legend?

Question Description

I am using vchart to make charts and have encountered two issues that I would like to ask everyone. My area chart style has been adjusted to a gradient color, but I don't want the legend color to follow the gradient of the area chart, how should I set it?

In addition, I did not find in the information that the legend shape provides a rounded rectangle option, is there any other plan to implement the drawing of rounded rectangles?

Image description

Solution

Hello, these two problems can be solved through configuration.

If you don't want the legend color to follow the gradient of the area chart, you can change the color of the main mark of the series by configuring the seriesMark.
seriesMark: 'point',
As for how to draw legends of rounded rectangles, you can set the symbolType graphic attribute of legend graphics by configuring it. The specific setting content is as follows:
item:{
shape:{
style:{
symbolType:"M 462 282 c 0 99.405 -80.595 180 -180 180 h -540 c -99.405 0 -180 -80.595 -180 -180 v -540 c 0 -99.405 80.595 -180 180 -180 h 540 c 99.405 0 180 80.595 180 180 v 540 z"
}
}
}

Image description

Result Show

Online demo: https://codesandbox.io/p/sandbox/line-chart-hover-forked-t74cvw?file=%2Fsrc%2Findex.ts%3A66%2C13

Related Documentation

...

🔧 In vchart, how do I set the legend not to follow the gradient color and draw a rounded rectangle legend?


📈 164.18 Punkte
🔧 Programmierung

🎥 Rounded corner gradient border #Shorts


📈 38.69 Punkte
🎥 Video | Youtube

📰 How to Enable a Custom Selection Rectangle Color in Windows 10 1809


📈 36.53 Punkte
📰 IT Security Nachrichten

🔧 Tìm Hiểu Về RAG: Công Nghệ Đột Phá Đang "Làm Mưa Làm Gió" Trong Thế Giới Chatbot


📈 35.8 Punkte
🔧 Programmierung

📰 Gradient AI Introduces Llama-3 8B Gradient Instruct 1048k: Setting New Standards in Long-Context AI


📈 35.49 Punkte
🔧 AI Nachrichten

🔧 How to configure tooltip and legend shape as rectangles with rounded corners


📈 33.75 Punkte
🔧 Programmierung

🔧 Abide by the Law and Follow the Flow: Conservation Laws for Gradient Flows


📈 32.94 Punkte
🔧 Programmierung

🔧 How to customize the shape of the legend in VChart?


📈 32.9 Punkte
🔧 Programmierung

🔧 How to configure the style of pager arrow in VChart legend?


📈 32.9 Punkte
🔧 Programmierung

🔧 How to achieve only selecting the current item in VChart when clicking on the legend?


📈 32.9 Punkte
🔧 Programmierung

🔧 Chrome 98 Beta: Color Gradient Vector Fonts, Region Capture Origin Trial, and More


📈 30.62 Punkte
🔧 Programmierung

🔧 Chrome 98 Beta: Color Gradient Vector Fonts, Region Capture Origin Trial, and More


📈 30.62 Punkte
🔧 Programmierung

📰 How to set accent color to cursor color on Windows 10


📈 29.87 Punkte
🖥️ Betriebssysteme

🪟 How to set accent color to cursor color on Windows 10


📈 29.87 Punkte
🪟 Windows Tipps

🔧 How to set VChart axis gridlines as dashed lines?


📈 29.13 Punkte
🔧 Programmierung

🔧 How to set the bar width of a bar chart in VChart


📈 29.13 Punkte
🔧 Programmierung

🔧 Can the VChart axis be set to avoid decimals?


📈 29.13 Punkte
🔧 Programmierung

🔧 How to set a default selected effect for VChart pie charts?


📈 29.13 Punkte
🔧 Programmierung

📰 Samsung Thinks Huawei P20 Looks So Cool, Launches Gradient Color on Galaxy Phone


📈 28.98 Punkte
📰 IT Security Nachrichten

📰 Samsung Launches Galaxy S9 with Ice Blue Gradient Color


📈 28.98 Punkte
📰 IT Security Nachrichten

📰 Samsung Quietly Launches a New Galaxy S9 Gradient Color


📈 28.98 Punkte
📰 IT Security Nachrichten

🔧 Issues with x-axis data overlap and y-axis data not being displayed when using vchart library


📈 28.64 Punkte
🔧 Programmierung

🕵️ mxGraph up to 4.0.0 on Confluence draw.io Diagrams Plugin Dialogs.js color cross site scripting


📈 28.26 Punkte
🕵️ Sicherheitslücken

⚠️ Adobe Flash Rectangle Return Use-After-Free


📈 25.29 Punkte
⚠️ PoC

⚠️ [dos] - Adobe Flash - Use-After-Free When Returning Rectangle


📈 25.29 Punkte
⚠️ PoC

⚠️ Adobe Flash Rectangle Return Use-After-Free


📈 25.29 Punkte
⚠️ PoC

⚠️ [dos] - Adobe Flash - Use-After-Free When Returning Rectangle


📈 25.29 Punkte
⚠️ PoC

📰 Rectangle für macOS erlaubt das Anpassen von Fenstergrößen und -positionen


📈 25.29 Punkte
📰 IT Nachrichten

📰 Rectangle: Fenster-Manager für macOS mit To-Do-Modus


📈 25.29 Punkte
📰 IT Nachrichten

🔧 Find minimum area of rectangle formed from given shuffled coordinates


📈 25.29 Punkte
🔧 Programmierung

🍏 Rectangle Pro 2.7.5


📈 25.29 Punkte
🍏 iOS / Mac OS

🍏 Rectangle 0.64 - Open source window manager based on the Spectacle app.


📈 25.29 Punkte
🍏 iOS / Mac OS

🍏 Rectangle Pro 2.8 - Quicker window snapping on macOS.


📈 25.29 Punkte
🍏 iOS / Mac OS

matomo