DEV Community

Cover image for Building charts and Dev UX
alessiochiffi
alessiochiffi

Posted on

Building charts and Dev UX

As a developer one of the frequent decisions I face is selecting the right library for charts on my projects.
It’s a critical choice, as the library can significantly impact both the ease of development and the end-user experience.

For a long time, I relied on Chart.js due to its simplicity and quick setup. However, I quickly encountered limitations. One major issue was the difficulty in customizing tooltips. While Chart.js does offer ways to create custom tooltips, including HTML tooltips, it’s not straightforward. Implementing custom HTML tooltips requires significant manual effort to manage tooltip elements.
Moreover, adapting Chart.js to work seamlessly with responsive designs posed another challenge. Customizing charts with media queries isn’t natively supported, and achieving the desired responsiveness required workarounds that felt more like hacks than solutions.

These limitations led me to explore other options, and that’s when I discovered Apache ECharts
https://echarts.apache.org/en/index.html
This library felt like a breath of fresh air. ECharts offers out-of-the-box support for advanced customizations and responsive designs.
The ability to easily integrate HTML content in tooltips without cumbersome workarounds made a huge difference in the workflow. Additionally, its responsive features are intuitive, making it easier to ensure that charts look great on all devices.

Code for a custom HTML tooltip
Image description

It not only enhanced the functionality and aesthetics of my charts but also streamlined my development process. If you’re facing similar issues with your charts, I highly recommend giving ECharts a try.

Top comments (0)